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
21 changes: 21 additions & 0 deletions pkg/cmd/controller/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ func NewControllerContext(
return nil, err
}

// Create a new clientConfig for high rate limit workloads.
// Increase kube QPS to at least 100 QPS, burst to at least 200 QPS.
highRateLimitClientConfig := rest.CopyConfig(inClientConfig)
if highRateLimitClientConfig.QPS < 100 {
highRateLimitClientConfig.QPS = 100
}
if highRateLimitClientConfig.Burst < 200 {
highRateLimitClientConfig.Burst = 200
}

openshiftControllerContext := &ControllerContext{
OpenshiftControllerConfig: config,

Expand All @@ -105,6 +115,14 @@ func NewControllerContext(
Namespace: defaultOpenShiftInfraNamespace,
},
},
HighRateLimitClientBuilder: OpenshiftControllerClientBuilder{
ControllerClientBuilder: controller.SAControllerClientBuilder{
ClientConfig: rest.AnonymousClientConfig(highRateLimitClientConfig),
CoreClient: kubeClient.CoreV1(),
AuthenticationClient: kubeClient.AuthenticationV1(),
Namespace: defaultOpenShiftInfraNamespace,
},
},
KubernetesInformers: informers.NewSharedInformerFactory(kubeClient, defaultInformerResyncPeriod),
OpenshiftConfigKubernetesInformers: informers.NewSharedInformerFactoryWithOptions(kubeClient, defaultInformerResyncPeriod, informers.WithNamespace("openshift-config")),
ControllerManagerKubeInformers: informers.NewSharedInformerFactoryWithOptions(kubeClient, defaultInformerResyncPeriod, informers.WithNamespace("openshift-controller-manager")),
Expand Down Expand Up @@ -154,6 +172,9 @@ type ControllerContext struct {

// ClientBuilder will provide a client for this controller to use
ClientBuilder ControllerClientBuilder
// HighRateLimitClientBuilder will provide a client for this controller utilizing a higher rate limit.
// This will have a rate limit of at least 100 QPS, with a burst up to 200 QPS.
HighRateLimitClientBuilder ControllerClientBuilder

KubernetesInformers informers.SharedInformerFactory
OpenshiftConfigKubernetesInformers informers.SharedInformerFactory
Expand Down
5 changes: 4 additions & 1 deletion pkg/cmd/controller/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ func RunServiceAccountController(ctx *ControllerContext) (bool, error) {
}

func RunServiceAccountPullSecretsController(ctx *ControllerContext) (bool, error) {
kc := ctx.ClientBuilder.ClientOrDie(iInfraServiceAccountPullSecretsControllerServiceAccountName)
// Bug 1785023: Increase the rate limit for the SA Pull Secrets controller.
// The pull secrets controller needs to create new dockercfg secrets at the same rate as the
// upstream token secret controller.
kc := ctx.HighRateLimitClientBuilder.ClientOrDie(iInfraServiceAccountPullSecretsControllerServiceAccountName)

go serviceaccountcontrollers.NewDockercfgDeletedController(
ctx.KubernetesInformers.Core().V1().Secrets(),
Expand Down