Open wuyanfeiwork opened 1 month ago
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration
networking:
podSubnet: 10.244.0.0/16,2001:db8:42:0::/56
serviceSubnet: 2001:db8:42:1::/112,10.96.0.0/16
imageRepository: "localhost:5000"
kubernetesVersion: "1.25.4"
---
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: "2408:4002:116a:0:6c2a:43c9:80c0:6664"
bindPort: 6443
nodeRegistration:
kubeletExtraArgs:
node-ip: 2408:4002:116a:0:6c2a:43c9:80c0:6664,192.168.0.1
I reset the Kubernetes cluster, and then moved the IPv4 address in the podSubnet
parameter of the kubeadm-config.yaml
file, 10.244.0.0/16
, to the front, ahead of the IPv6 address 2001:db8:42:0::/56
, and re-initialized the Kubernetes cluster. Now flannel starts up normally.
I don’t quite understand why this is?
Is it prioritizing the IPv6? I tried to read the logs and it's strange that you didn't get the IPv4 there; it should get both IPs independently from the order. To prioritize IPv6 I think that it's enough the order of node-ip on the Kubelet args.
I need to configure flannel for dual-stack mode, my Kubernetes has been initialized for dual-stack mode, below is my
kubeadm-config.yaml
file:I need the communication within the cluster to prioritize using IPv6, so I put the IPv6 address before the IPv4 address.
Below are the network-related configurations for flannel:
The error message when starting flannel is as follows:
I don’t understand why it prompts: Observed a panic:
Address is not an IPv4 address
.My server has both IPv4 and IPv6 addresses:
I changed
EnableIPv4
tofalse
, and Flannel can start normally.But my requirement is to support both IPv4 and IPv6, with communication between Pods and Nodes prioritizing IPv6.