You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #16807 from danwinship/validate-ipv4
Automatic merge from submit-queue.
Require network API objects to have IPv4 addresses
https://bugzilla.redhat.com/show_bug.cgi?id=1500664 points out problems that occur if you specify an IPv6 EgressIP. In fact, we shouldn't be allowing IPv6 addresses for any network API objects:
- `ClusterNetwork.Network` / `ClusterNetwork.ClusterNetworks[].CIDR` must be IPv4 because we only support an IPv4 SDN right now, for multiple reasons throughout kube and the SDN code. (Among other things, the HostSubnet allocator implicitly assumes IPv4, so while it's currently possible to start up a master with an IPv6 `clusterNetworkCIDR` value, it won't ever succeed in allocating any HostSubnets, so no nodes will ever successfully start up.)
- `ClusterNetwork.ServiceNetwork` must be IPv4 because kube-proxy only supports all-IPv4 or all-IPv6, and service rules must be able to refer to pod IPs, and since those are IPv4, then service IPs must be IPv4 too.
- `HostSubnet.HostIP` must be IPv4 because the node's IP address is used in kube-proxy rules, which per the above must be IPv4 only
- `HostSubnet.Subnet` must be IPv4 because it's a subset of the cluster network, which is IPv4
- `HostSubnet.EgressIPs` must be IPv4 because they are used for NATting in iptables rules.
- `NetNamespace.EgressIPs` must be IPv4 because they have to match some hostsubnet's `EgressIPs`.
- `EgressNetworkPolicyPeer.CIDRSelector` ... well, ... actually I guess these don't *need* to be IPv4; it's pointless to specify an IPv6 value here since pods don't have IPv6 connectivity, but nothing will break if you do.
So this PR requires all of the above except `EgressNetworkPolicyPeer.CIDRSelector` to be IPv4.
//In the case that a user manually makes a clusterNetwork object with clusterNet.Network and clusterNet.HostubnetLength at least make sure they are valid values
0 commit comments