Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Which ip address are we using when there are both IPv4 and IPv6? #783

Closed
Random-Liu opened this issue May 23, 2018 · 6 comments
Closed

Which ip address are we using when there are both IPv4 and IPv6? #783

Random-Liu opened this issue May 23, 2018 · 6 comments
Assignees
Milestone

Comments

@Random-Liu
Copy link
Member

From the code, it is not very obvious to me:

@abhi

@Random-Liu Random-Liu added this to the v1.11 milestone May 23, 2018
@jingax10
Copy link

jingax10 commented Jun 4, 2018

@abhi any update? Thanks!

@abhi
Copy link
Member

abhi commented Jun 4, 2018

The result from the cni plugin will have list of IPs for every interface. If there is 1 IP then it could be either ipv6 or ipv4 depending on what is assigned to each interface. So techincally if only IPv6 address is assigned, this what will be picked by cri-containerd.

@jingax10
Copy link

jingax10 commented Jun 4, 2018

Thanks @abhi! In case CNI plugin return one IPv4 and IPv6 address for an interface, what is the rule to pick up the address for the pod? Is IPv4 be preferred? Thanks!

@abhi
Copy link
Member

abhi commented Jun 4, 2018

@jingax10 at this point it will be the first IP from the cni result. So essentially the ordering is defined by the cni plugin. Whatever it stamps as the first IP in the slice.
Is there a preference we need to consider here ?

@jingax10
Copy link

jingax10 commented Jun 4, 2018

@abhi, thanks for clarification! Could we get the same behavior as dockershim https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockershim/docker_sandbox.go#L336 does today? Thanks!

@abhi
Copy link
Member

abhi commented Jun 4, 2018

Do you happen to know about reason for that convention ?
Mostly because there is a difference in the approach we took in cri using the go-cni library.
We used the result from the cni plugin as the source of truth as opposed to checking the ip of the interface inside the sandbox container.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants