Skip to content
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

daemon: Make L2 neighbor discovery configurable. #16974

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/cmdref/cilium-agent.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions daemon/cmd/daemon_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ func init() {
flags.Duration(option.ARPPingRefreshPeriod, 5*time.Minute, "Period for remote node ARP entry refresh (set 0 to disable)")
option.BindEnv(option.ARPPingRefreshPeriod)

flags.Bool(option.EnableL2NeighDiscovery, true, "Enables L2 neighbor discovery used by kube-proxy-replacement and IPsec")
option.BindEnv(option.EnableL2NeighDiscovery)

flags.Bool(option.AutoCreateCiliumNodeResource, defaults.AutoCreateCiliumNodeResource, "Automatically create CiliumNode resource for own node on startup")
option.BindEnv(option.AutoCreateCiliumNodeResource)

Expand Down
2 changes: 2 additions & 0 deletions pkg/datapath/linux/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,8 @@ func (n *linuxNodeHandler) NodeConfigurationChanged(newConfig datapath.LocalNode
if n.nodeConfig.EnableIPv4 {
ifaceName := ""
switch {
case !option.Config.EnableL2NeighDiscovery:
n.enableNeighDiscovery = false
case option.Config.EnableNodePort:
mac, err := link.GetHardwareAddr(option.Config.DirectRoutingDevice)
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions pkg/option/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ const (
// ARPPingRefreshPeriod is the ARP entries refresher period
ARPPingRefreshPeriod = "arping-refresh-period"

// EnableL2NeighDiscovery determines if cilium should perform L2 neighbor
// discovery.
EnableL2NeighDiscovery = "enable-l2-neigh-discovery"

// BPFRoot is the Path to BPF filesystem
BPFRoot = "bpf-root"

Expand Down Expand Up @@ -1955,6 +1959,9 @@ type DaemonConfig struct {

// VLANBPFBypass list of explicitly allowed VLAN id's for bpf logic bypass
VLANBPFBypass []int
// EnableL2NeighDiscovery determines if cilium should perform L2 neighbor
// discovery.
EnableL2NeighDiscovery bool
}

var (
Expand Down Expand Up @@ -2353,6 +2360,7 @@ func (c *DaemonConfig) Populate() {
c.AllowLocalhost = viper.GetString(AllowLocalhost)
c.AnnotateK8sNode = viper.GetBool(AnnotateK8sNode)
c.ARPPingRefreshPeriod = viper.GetDuration(ARPPingRefreshPeriod)
c.EnableL2NeighDiscovery = viper.GetBool(EnableL2NeighDiscovery)
c.AutoCreateCiliumNodeResource = viper.GetBool(AutoCreateCiliumNodeResource)
c.BPFRoot = viper.GetString(BPFRoot)
c.CertDirectory = viper.GetString(CertsDirectory)
Expand Down