This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 192
IPv6: Some host network pods get pod IP set to kube-vip control plane endpoint address #2098
Labels
Comments
mcwumbly
added a commit
that referenced
this issue
Apr 11, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: #2098 Co-authored-by: Christian Ang <angc@vmware.com>
3 tasks
vuil
pushed a commit
to vuil/tanzu-framework
that referenced
this issue
Apr 25, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: vmware-tanzu#2098 Co-authored-by: Christian Ang <angc@vmware.com>
vuil
pushed a commit
to vuil/tanzu-framework
that referenced
this issue
Apr 25, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: vmware-tanzu#2098 Co-authored-by: Christian Ang <angc@vmware.com>
mcwumbly
added a commit
that referenced
this issue
Apr 26, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider-vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: #2098 Co-authored-by: Christian Ang <angc@vmware.com>
mcwumbly
added a commit
to mcwumbly/tanzu-framework
that referenced
this issue
Apr 26, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider-vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: vmware-tanzu#2098 Backport of: vmware-tanzu#2103 Co-authored-by: Christian Ang <angc@vmware.com>
3 tasks
chandrareddyp
pushed a commit
to chandrareddyp/tanzu-framework
that referenced
this issue
Apr 28, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider-vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: vmware-tanzu#2098 Co-authored-by: Christian Ang <angc@vmware.com>
vuil
pushed a commit
that referenced
this issue
Apr 29, 2022
On IPv6 only clusters or dual stack clusters with IPv6 as the primary IP family, configure `--node-ip` for kubelet on the control plane nodes to the first detected IP address prior to launching kube-vip. Otherwise, prior to cloud-provider-vsphere taking over, kubelet will use the kube-vip address as the node IP and host network pods that start up early will get this address set as their pod IP. See: #2098 Backport of: #2103 Co-authored-by: Christian Ang <angc@vmware.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Bug description
Follow up to #1480 and #1964
On IPv6 clusters, three pods on the first control plane node come up the kube-vip control plane endpoint IP address as their pod IP address. In clusters with multiple control plane nodes, the kube-vip address then fails over to another node, but these pods continue to retain that address as their pod IP. This could cause issues for anything that needs to reach them via that IP.
These pods consistently get assigned the wrong address:
etcd
,kube-apiserver
,kube-proxy
.The following shows the issue on a cluster with 3 control plane nodes with those pods using the cluster endpoint IP(
2013:930::161
) as their pod IP:When the control plane node is first coming up, cloud-provider-vsphere is not yet running, so the feature added in #1480 and #1964 to exclude the kube-vip address from node.Addresses is not yet used. During this phase, other fallback logic is used by kubelet to determine the node IP. (see kubernetes/kubernetes#96670).
At this time, kube-vip, which gets deployed as a static manifest, is already running, so the kube-vip IP has been added to the network device. In IPv4, this has apparently never caused this problem. But in IPv6, we see it consistently. We believe this is due to the fact that IP addresses are returned in the order they are added for IPv4, but in reverse order for IPv6 (via serverfault).
The workaround suggested in the kubernetes issue is to use the --node-ip flag for kubelet. However, kubeadm doesn't support doing so in a first-class way, so the suggestion there is to use KUBELET_EXTRA_ARGS (see kubernetes/kubeadm#203).
Doing so via
ytt
and ClusterAPI is difficult as we do not know the node IP in advance and determining it from cloud-init metadata is messy, so we need to use some heuristic to detect the IP address.This overlay has been tested in a few cases, but we need to ensure it robust enough to include in the product:
Expected behavior
TKG_IP_FAMILY=ipv6
andVSPHERE_CONTROL_PLANE_ENDPOINT=$some-ip
kubectl get pods -A -o wide
$some-ip
as their IP addressSteps to reproduce the bug
TKG_IP_FAMILY=ipv6
andVSPHERE_CONTROL_PLANE_ENDPOINT=$some-ip
kubectl get pods -A -o wide
$some-ip
as their IP addressVersion (include the SHA if the version is not obvious)
v0.11.4
andv0.20.0
Environment where the bug was observed (cloud, OS, etc)
IPv6 vSphere
Note: this most likely also affects
TKG_IP_FAMILY=ipv6,ipv4
The text was updated successfully, but these errors were encountered: