Skip to content

Commit 809ce56

Browse files
committed
cilium: Clean up cmdline param wrt control plane mode
Get rid of the --bpf-lb-external-control-plane parameter in favor of simply just reusing existing --enable-k8s flag instead. The latter is already part of the k8s client hive cell which is even better. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: #33552 (comment)
1 parent acce633 commit 809ce56

7 files changed

Lines changed: 6 additions & 29 deletions

File tree

Documentation/cmdref/cilium-agent.md

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Documentation/operations/upgrade.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ communicating via the proxy must reconnect to re-establish connections.
294294
------------------
295295

296296
* Operating Cilium in ``--datapath-mode=lb-only`` for plain Docker mode now requires to
297-
add an additional ``--bpf-lb-external-control-plane=true`` to the command line, otherwise
298-
it is assumed that Kubernetes is present.
297+
add an additional ``--enable-k8s=false`` to the command line, otherwise it is assumed
298+
that Kubernetes is present.
299299
* The Kubernetes clients used by Cilium Agent and Cilium Operator now have separately configurable
300300
rate limits. The default rate limit for Cilium Operator K8s clients has been increased to
301301
100 QPS/200 Burst. To configure the rate limit for Cilium Operator, use the

daemon/cmd/daemon.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,6 @@ func newDaemon(ctx context.Context, cleaner *daemonCleanup, params *daemonParams
296296

297297
bootstrapStats.daemonInit.Start()
298298

299-
// Validate configuration options that depend on other cells.
300-
if option.Config.IdentityAllocationMode == option.IdentityAllocationModeCRD &&
301-
!option.Config.LoadBalancerExternalControlPlane &&
302-
!params.Clientset.IsEnabled() {
303-
return nil, nil, fmt.Errorf("CRD Identity allocation mode requires k8s to be configured")
304-
}
305-
306299
// EncryptedOverlay feature must check the TunnelProtocol if enabled, since
307300
// it only supports VXLAN right now.
308301
if option.Config.EncryptionEnabled() && option.Config.EnableIPSecEncryptedOverlay {
@@ -839,7 +832,8 @@ func newDaemon(ctx context.Context, cleaner *daemonCleanup, params *daemonParams
839832
// well known identities have already been initialized above.
840833
// Ignore the channel returned by this function, as we want the global
841834
// identity allocator to run asynchronously.
842-
if !option.Config.LoadBalancerExternalControlPlane {
835+
if option.Config.IdentityAllocationMode != option.IdentityAllocationModeCRD ||
836+
params.Clientset.IsEnabled() {
843837
realIdentityAllocator := d.identityAllocator
844838
realIdentityAllocator.InitIdentityAllocator(params.Clientset)
845839
}

daemon/cmd/daemon_main.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,6 @@ func InitGlobalFlags(cmd *cobra.Command, vp *viper.Viper) {
602602
flags.String(option.LoadBalancerRSSv6CIDR, "", "BPF load balancing RSS outer source IPv6 CIDR prefix for IPIP")
603603
option.BindEnv(vp, option.LoadBalancerRSSv6CIDR)
604604

605-
flags.Bool(option.LoadBalancerExternalControlPlane, false, "BPF load balancer uses an externally-provided control plane")
606-
option.BindEnv(vp, option.LoadBalancerExternalControlPlane)
607-
608605
flags.String(option.LoadBalancerAcceleration, option.NodePortAccelerationDisabled, fmt.Sprintf(
609606
"BPF load balancing acceleration via XDP (\"%s\", \"%s\")",
610607
option.NodePortAccelerationNative, option.NodePortAccelerationDisabled))
@@ -1720,10 +1717,6 @@ func newDaemonPromise(params daemonParams) (promise.Promise[*Daemon], promise.Pr
17201717
daemonCtx, cancelDaemonCtx := context.WithCancel(context.Background())
17211718
cleaner := NewDaemonCleanup()
17221719

1723-
if option.Config.LoadBalancerExternalControlPlane {
1724-
params.Clientset.Disable()
1725-
}
1726-
17271720
var daemon *Daemon
17281721
var wg sync.WaitGroup
17291722

pkg/option/config.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,6 @@ const (
277277
// Alias to NodePortAcceleration
278278
LoadBalancerAcceleration = "bpf-lb-acceleration"
279279

280-
// LoadBalancerExternalControlPlane switch skips connectivity to kube-apiserver
281-
// which is relevant in lb-only mode
282-
LoadBalancerExternalControlPlane = "bpf-lb-external-control-plane"
283-
284280
// MaglevTableSize determines the size of the backend table per service
285281
MaglevTableSize = "bpf-lb-maglev-table-size"
286282

@@ -1992,10 +1988,6 @@ type DaemonConfig struct {
19921988
LoadBalancerRSSv6CIDR string
19931989
LoadBalancerRSSv6 net.IPNet
19941990

1995-
// LoadBalancerExternalControlPlane tells whether to not use kube-apiserver as
1996-
// its control plane in lb-only mode.
1997-
LoadBalancerExternalControlPlane bool
1998-
19991991
// EnablePMTUDiscovery indicates whether to send ICMP fragmentation-needed
20001992
// replies to the client (when needed).
20011993
EnablePMTUDiscovery bool
@@ -3131,7 +3123,6 @@ func (c *DaemonConfig) Populate(vp *viper.Viper) {
31313123
c.LoadBalancerDSRL4Xlate = vp.GetString(LoadBalancerDSRL4Xlate)
31323124
c.LoadBalancerRSSv4CIDR = vp.GetString(LoadBalancerRSSv4CIDR)
31333125
c.LoadBalancerRSSv6CIDR = vp.GetString(LoadBalancerRSSv6CIDR)
3134-
c.LoadBalancerExternalControlPlane = vp.GetBool(LoadBalancerExternalControlPlane)
31353126
c.InstallNoConntrackIptRules = vp.GetBool(InstallNoConntrackIptRules)
31363127
c.ContainerIPLocalReservedPorts = vp.GetString(ContainerIPLocalReservedPorts)
31373128
c.EnableCustomCalls = vp.GetBool(EnableCustomCallsName)

test/l4lb/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ docker exec -t lb-node \
6565
cilium-agent \
6666
--enable-ipv4=true \
6767
--enable-ipv6=false \
68+
--enable-k8s=false \
6869
--datapath-mode=lb-only \
69-
--bpf-lb-external-control-plane=true \
7070
--bpf-lb-algorithm=maglev \
7171
--bpf-lb-dsr-dispatch=ipip \
7272
--bpf-lb-acceleration=native \

test/nat46x64/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fi
1313
CILIUM_EXEC="docker exec -t lb-node docker exec -t cilium-lb"
1414

1515
CFG_COMMON=("--enable-ipv4=true" "--enable-ipv6=true" "--devices=eth0" \
16-
"--datapath-mode=lb-only" "--bpf-lb-external-control-plane=true" \
16+
"--datapath-mode=lb-only" "--enable-k8s=false" \
1717
"--bpf-lb-mode=snat" "--enable-nat46x64-gateway=true")
1818

1919
TXT_XDP_MAGLEV="Mode:XDP\tAlgorithm:Maglev\tRecorder:Disabled"

0 commit comments

Comments
 (0)