Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/onsi/gomega v1.44.0
github.com/opencontainers/image-spec v1.1.1
github.com/pkg/errors v0.9.1
github.com/projectsveltos/libsveltos v1.17.0
github.com/projectsveltos/libsveltos v1.17.1-0.20261101135809-65798348bae6
github.com/prometheus/client_golang v1.25.0
github.com/sigstore/cosign/v3 v3.1.4
github.com/sigstore/sigstore v1.11.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY=
github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg=
github.com/projectsveltos/libsveltos v1.17.0 h1:7oIvY+bg9oLRYm8wlyZypYVvCcMspYl/FT9VG8XvQG0=
github.com/projectsveltos/libsveltos v1.17.0/go.mod h1:dHJrl1V5/WrNda5wzxbHs2dlsvoV/FUlwK1TXy2X3pA=
github.com/projectsveltos/libsveltos v1.17.1-0.20261101135809-65798348bae6 h1:lwfrK/ZH9Ee2YAcEdbS0T18QMp/ea7BvEt967oKQnu4=
github.com/projectsveltos/libsveltos v1.17.1-0.20261101135809-65798348bae6/go.mod h1:dHJrl1V5/WrNda5wzxbHs2dlsvoV/FUlwK1TXy2X3pA=
github.com/projectsveltos/lua-utils/glua-json v0.0.0-20251212200258-2b3cdcb7c0f5 h1:khnc+994UszxZYu69J+R5FKiLA/Nk1JQj0EYAkwTWz0=
github.com/projectsveltos/lua-utils/glua-json v0.0.0-20251212200258-2b3cdcb7c0f5/go.mod h1:yVL8KQFa9tmcxgwl9nwIMtKgtmIVC1zaFRSCfOwYvPY=
github.com/projectsveltos/lua-utils/glua-runes v0.0.0-20251212200258-2b3cdcb7c0f5 h1:YbsebwRwTRhV8QacvEAdFqxcxHdeu7JTVtsBovbkgos=
Expand Down
26 changes: 20 additions & 6 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import (
"github.com/projectsveltos/addon-controller/controllers/dependencymanager"
"github.com/projectsveltos/addon-controller/internal/telemetry"
libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1"
"github.com/projectsveltos/libsveltos/lib/clusterproxy"
"github.com/projectsveltos/libsveltos/lib/crd"
"github.com/projectsveltos/libsveltos/lib/deployer"
logs "github.com/projectsveltos/libsveltos/lib/logsettings"
Expand All @@ -86,6 +87,8 @@ var (
tmpReportMode int
restConfigQPS float32
restConfigBurst int
managedClusterQPS float32
managedClusterBurst int
webhookPort int
syncPeriod time.Duration
conflictRetryTime time.Duration
Expand Down Expand Up @@ -137,6 +140,7 @@ func Run() {
ctrlOptions := getCtrlOptions(scheme)

restConfig := getRestConfig()
clusterproxy.SetRestConfigLimits(managedClusterQPS, managedClusterBurst)

ctx := ctrl.SetupSignalHandler()

Expand Down Expand Up @@ -282,15 +286,25 @@ func initFlags(fs *pflag.FlagSet) {
fs.StringVar(&registry, "registry", "",
"Container registry for drift-detection images. Defaults to docker.io/ if empty.")

const defautlRestConfigQPS = 20
const defautlRestConfigQPS = 40
fs.Float32Var(&restConfigQPS, "kube-api-qps", defautlRestConfigQPS,
fmt.Sprintf("Maximum queries per second from the controller client to the Kubernetes API server. Defaults to %d",
defautlRestConfigQPS))
fmt.Sprintf("Maximum queries per second from the controller client to the management cluster Kubernetes API server. "+
"Defaults to %d", defautlRestConfigQPS))

const defaultRestConfigBurst = 60
const defaultRestConfigBurst = 120
fs.IntVar(&restConfigBurst, "kube-api-burst", defaultRestConfigBurst,
fmt.Sprintf("Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Default %d",
defaultRestConfigBurst))
fmt.Sprintf("Maximum number of queries that should be allowed in one burst from the controller client to the "+
"management cluster Kubernetes API server. Default %d", defaultRestConfigBurst))

const defaultManagedClusterRestConfigQPS = 20
fs.Float32Var(&managedClusterQPS, "managed-cluster-kube-api-qps", defaultManagedClusterRestConfigQPS,
fmt.Sprintf("Maximum queries per second from the controller client to the Kubernetes API server of each managed cluster. "+
"Defaults to %d", defaultManagedClusterRestConfigQPS))

const defaultManagedClusterRestConfigBurst = 60
fs.IntVar(&managedClusterBurst, "managed-cluster-kube-api-burst", defaultManagedClusterRestConfigBurst,
fmt.Sprintf("Maximum number of queries that should be allowed in one burst from the controller client to the "+
"Kubernetes API server of each managed cluster. Default %d", defaultManagedClusterRestConfigBurst))

const defaultWebhookPort = 9443
fs.IntVar(&webhookPort, "webhook-port", defaultWebhookPort,
Expand Down
Loading