-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid stressing memory by watching arbitrary secrets on the cluster #151
Comments
The fix didnt help. |
The warden admission problem is caused by the To test it I've used such script: #!/bin/bash
kyma provision k3d
kubectl create namespace kyma-system
operatorManifest=$(helm upgrade --install --wait --set global.config.data.logging.level=debug --set admission.enabled=true --dry-run=server -o yaml warden ./charts/warden/)
# create 2k secrets with huge data
x=1
secretData="${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}${operatorManifest}"
while [ $x -le 2000 ]; do
kubectl create secret generic secret-$x --from-literal data="${secretData}"
x=$(( $x + 1 ))
done
# install warden
helm upgrade --install --wait --set global.config.data.logging.level=debug --set admission.enabled=true warden ./charts/warden/ To test it without the docker build -t pprecel/admission:0.1 -f docker/admission/Dockerfile .
docker push pprecel/admission:0.1 and replaced the admissions image in the values.yaml |
Setting predicates to turn off all processing doesn't help if err := c.Watch(&source.Kind{
Type: &corev1.Secret{}},
&handler.EnqueueRequestForObject{},
predicate.Funcs{
CreateFunc: func(e event.CreateEvent) bool { return false },
DeleteFunc: func(e event.DeleteEvent) bool { return false },
UpdateFunc: func(e event.UpdateEvent) bool { return false },
GenericFunc: func(e event.GenericEvent) bool { return false },
}, I think the sceret watcher is used to await changes just in the webhook secret. if we could watch just one secret it would be great |
Fixed in #188, OOMkilled issue no longer appears |
Description
Exclude secrets and config maps from being auto-loaded to controllers cache
Reasons
Controller's cache can take huge amount of memory (causing exceeded limit and OOM killing by k8s control-plane) in case there is a vast amount of secrets/ config maps in the cluster.
Attachments
The text was updated successfully, but these errors were encountered: