forked from kubernetes-retired/kubeadm-dind-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IPv6: Adjust subnet prefix used for NAT64.
This commit does several things related to the NAT64 prefix, as specified by the NAT64_V4_SUBNET_PREFIX environment variable. This prefix is for a /16 subnet. First, we want the prefix to be within one of the two private network ranges (172.16.0.0/12 or 10.0.0.0/8). Second, to accommodate that, the NAT64_V4_SUBNET_PREFIX will be two octets, instead of one. The default, if not specified, will be 172.18, to avoid docker usage of that private network. Third, the code will range check the prefix, to ensure that it is within range, based on the private network selected. 172.16 to 172.31 or 10.0 to 10.253 values are allowed. Fourth, the cluster ID is added to the prefix, so that a unique subnet is used for each cluster. This affects the allowable values for the prefix. For 172.16.0.0/12, the prefix plus cluster ID must be from 172.16 to 172.31. For 10.0.0.0/8, the prefix plus cluster ID must be from 10.0 to 10.253. So, for example, if the default 172.18 is used, then cluster IDs can be from 0 to 13. Another side effect of this change is w.r.t. legacy mode, where the user specifies (only) the DIND_LABEL. In that case, a cluster ID is generated, and we now will use numbers from 1..13 to help keep the values within the range for the V4 mapping prefix (using 13 instead of 15 as the default prefix is 172.18). If the user wants to use the legacy DIND_LABEL, but have a larger range for cluster IDs, they can set the NAT64_V4_SUBNET_PREFIX to the 10.0.0.0/8 subnet and/or explicitly set the CLUSTER_ID. For the multicluster IPv6 CI test, it creates a cluster using the default cluster ID (0), one with cluster ID specified (20), and legacy mode with q cluster ID generated between 1..13. Since the default prefix is 172.18, the second cluster will create a prefix (172.18 + 20 = 172.38) that is outside the 172.16.0.0/12 private network and will be rejected. To avoid this, we'll use a base prefix of 10.100. That will use 10.100 for the first cluster, 10.120 for the second cluster, and a random value of 10.101 to 10.113 for the third cluster. This avoids any conflict, and ensures that the prefix is within the 10.0.0.0/8 private network. Fixes Issue: kubernetes-retired#220
- Loading branch information
Paul Michali
committed
Sep 24, 2018
1 parent
4b42c7d
commit bb422a3
Showing
8 changed files
with
292 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.