Skip to content

Commit

Permalink
policy: allow qps config
Browse files Browse the repository at this point in the history
Signed-off-by: l1b0k <[email protected]>
  • Loading branch information
l1b0k committed Jan 10, 2025
1 parent 864af04 commit 5196274
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions policy/cilium/0037-add-the-k8s-client-qps-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: l1b0k <[email protected]>
Date: Mon, 6 Jan 2025 20:10:48 +0800
Subject: add the k8s client qps config

Signed-off-by: l1b0k <[email protected]>
Signed-off-by: l1b0k <[email protected]>
---
daemon/cmd/daemon_main.go | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/daemon/cmd/daemon_main.go b/daemon/cmd/daemon_main.go
index 4812da39c7..682521ea6a 100644
--- a/daemon/cmd/daemon_main.go
+++ b/daemon/cmd/daemon_main.go
@@ -393,6 +393,9 @@ func initializeFlags() {
flags.Bool(option.EnableInClusterLoadBalance, false, "Enable k8s in cluster loadbalance")
option.BindEnv(option.EnableInClusterLoadBalance)

+ flags.Float32(option.K8sClientQPSLimit, defaults.K8sClientQPSLimit, "Queries per second limit for the K8s client")
+ flags.Int(option.K8sClientBurst, defaults.K8sClientBurst, "Burst value allowed for the K8s client")
+
flags.Bool(option.K8sEnableEndpointSlice, defaults.K8sEnableEndpointSlice, "Enables k8s EndpointSlice feature in Cilium if the k8s cluster supports it")
option.BindEnv(option.K8sEnableEndpointSlice)

@@ -1206,7 +1209,7 @@ func initEnv(cmd *cobra.Command) {
// Configure k8s as soon as possible so that k8s.IsEnabled() has the right
// behavior.
bootstrapStats.k8sInit.Start()
- k8s.Configure(option.Config.K8sAPIServer, option.Config.K8sKubeConfigPath, defaults.K8sClientQPSLimit, defaults.K8sClientBurst)
+ k8s.Configure(option.Config.K8sAPIServer, option.Config.K8sKubeConfigPath, float32(option.Config.K8sClientQPSLimit), option.Config.K8sClientBurst)
bootstrapStats.k8sInit.End(true)

for _, grp := range option.Config.DebugVerbose {
--
2.39.5 (Apple Git-154)

0 comments on commit 5196274

Please sign in to comment.