Skip to content

Commit

Permalink
Remove secrets and configmaps from the cache (#170)
Browse files Browse the repository at this point in the history
* Remove secrets and configmaps from the cache

* Bump images
  • Loading branch information
MichalKalke authored Jan 4, 2024
1 parent f1863e7 commit e815e56
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/warden/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ global:
wardenPriorityClassName: warden-priority
wardenPriorityClassValue: 2000000
operator:
image: europe-docker.pkg.dev/kyma-project/prod/warden/operator:v20231222-48a12c63
image: europe-docker.pkg.dev/kyma-project/dev/warden/operator:PR-170
resources:
requests:
cpu: 10m
Expand All @@ -30,7 +30,7 @@ global:
memory: 160Mi

admission:
image: europe-docker.pkg.dev/kyma-project/prod/warden/admission:v20231222-48a12c63
image: europe-docker.pkg.dev/kyma-project/dev/warden/admission:PR-170
resources:
requests:
cpu: 10m
Expand Down
5 changes: 5 additions & 0 deletions cmd/admission/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/manager"
ctrlwebhook "sigs.k8s.io/controller-runtime/pkg/webhook"
)
Expand Down Expand Up @@ -108,6 +109,10 @@ func main() {
Port: appConfig.Admission.Port,
MetricsBindAddress: ":9090",
Logger: logrZap,
ClientDisableCacheFor: []ctrlclient.Object{
&corev1.Secret{},
&corev1.ConfigMap{},
},
})
if err != nil {
logger.Error("failed to start manager", err.Error())
Expand Down
6 changes: 6 additions & 0 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ import (

"go.uber.org/zap"
"go.uber.org/zap/zapcore"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
ctrlclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/healthz"
zapk8s "sigs.k8s.io/controller-runtime/pkg/log/zap"
//+kubebuilder:scaffold:imports
Expand Down Expand Up @@ -97,6 +99,10 @@ func main() {
LeaderElection: appConfig.Operator.LeaderElect,
LeaderElectionID: "c3790980.warden.kyma-project.io",
Logger: logrZap,
ClientDisableCacheFor: []ctrlclient.Object{
&corev1.Secret{},
&corev1.ConfigMap{},
},
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down

0 comments on commit e815e56

Please sign in to comment.