-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SLAAC IPAM #1016
Comments
they have to be returned as the response of the CNI ADD command |
This issue is not just simple as above. In my conclusion, current CNI and Kubernetes does not support IPv6 SLAAC address. Current CNI plugin (at least, under https://github.com/containernetworking/plugins/) does not care IPv6 SLAAC addressSLAAC IP configuration is asynchronous to interface creation, actually. After interface creation, linux kernel will send a router solicitation and its reply (i.e. router advertisement) contains the network prefix, then IP autoconfiguration (i.e. DAD, duplicated address ditection) is started. Hence even though CNI plugin finishes their task, SLAAC process may be still on going. SLAAC may change the IP address, but Kubernetes/CNI cannot have a way to track the changesSLAAC provide a method to configure IPv6 address automatically based on prefix advertised by a local router, hence if the router provides different prefix then Pod's address will automatically re-configured (i.e. changed). Currently CNI plugins are only invoked at Pod creation and Pod deletion, hence Kubernetes does not capture Pod's re-configured address. SLAAC may have multiple IP address to an interface but Kubernetes does not support multiple IPv6 address for a PodSLAAC, defined in https://tex2e.github.io/rfc-translater/html/rfc7217.html, introduces multiple IPv6 address to an interfaces. If user network has two or more network prefix, an interface has two or more IPv6 addresses, for each network prefix. In addition, even if user network has only one network prefix, "temporary addresses" is assigned to an interfaces, additionally. So IPv6 and SLAAC are designed to have multiple IP addresses in an interface. But on the other side, current Kubernetes only supports one IP address for each protocol (i.e. IPv4/v6). Hence Kubernetes cannot handle multiple IPv6 address. As of above reasons, currently SLAAC IPv6 address is not handling in Kubernetes/CNI yet. |
Let me explain myself better, kubernetes pods are ephemeral, the lifecycle of a Pod is start -> run -> stop, so there is no concept of dynamic IPs on Pods. It will be interesting to know your use case for having a Pod that is running and changing IPs though ... If you want to represent an IP address to kubernetes , as in pod.status.PodIP, it has to be returned as the response of the CNI ADD , it is up to the plugin implementation how to obtain this IP, you can use dhcp, slaac or static IP assignment to get this IP , but kubernetes will be only aware of the IP that is in the response of the CNI ADD |
I actually wrote a SLAAC ipam plugin once, and it totally worked. (The branch is long gone, that laptop is like 3 acquisitions old 😆). The basic step was:
It totally worked! If you want to re-create it, I'd be happy to merge it. |
I use the macvlan plugin for Kubernetes, and my pods autoconfigure IPv6 addresses using SLAAC, but those addresses aren't exposed to Kubernetes.
How to achieve this?
The text was updated successfully, but these errors were encountered: