-
Notifications
You must be signed in to change notification settings - Fork 20
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
Modify Pod netrowk setup #175
Conversation
4ea16a3
to
ff17164
Compare
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
v2/pkg/nodenet/pod.go
Outdated
IPNet: ipnet, | ||
Scope: unix.RT_SCOPE_UNIVERSE, | ||
}) | ||
if err != nil { | ||
netlink.LinkDel(cLink) | ||
return fmt.Errorf("netlink: failed to add an address: %w", err) | ||
} | ||
err = netlink.AddrAdd(cLink, &netlink.Addr{ | ||
IPNet: &net.IPNet{IP: containerIPv4, Mask: net.CIDRMask(30, 32)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
net.CIDRMask(30, 32)
This should be defined as a constant, I mean, a variable used as a constant.
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Yusuke Suzuki <yusuke-suzuki@cybozu.co.jp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR modifies Pod network setting to have Linux kernel select a global scope address as a source IP in communication between a node and a local Pod. Cilium seems to assume that a source IP is a localhost address, so we tweak Coil's Pod network setup.
With the settings described above, Linux kernel recognizes the communication between a node and a local Pod as L3 and selects a global scope address as a source IP.