You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because kube-secret-init cannot read any kubernetes secrets (as configured in the RBAC) and, the pod mutation is blocked regardless of:
the optional: true set in the pod manifest (for both envFrom and env:secretKeyRef)
other env vars (from env:value and configmaps) referencing GCP SM secrets
Plus, the logs of the kube-secrets-init are not specific about any of this. The only log line is: level=debug msg="no pod init containers were mutated".
Only the ReplicaSet controller shows some information:
Warning FailedCreate 66s replicaset-controller Error creating: Internal error occurred: failed calling webhook "pods.kube-secrets-init.admission.doit-intl.com": failed to call webhook: an error on the server ("{\"kind\":\"AdmissionReview\",\"apiVersion\":\"admission.k8s.io/v1beta1\",\"response\":{\"uid\":\"6ebe4fad-6f30-49d1-8bf0-b2880ff77b8a\",\"allowed\":false,\"status\":{\"metadata\":{},\"status\":\"Failure\",\"message\":\"could not mutate object: failed to mutate pod: : failed to mutate containers for pod : failed to look for envFrom: failed to get secret secretspoc/svcc-secrets: failed to get secret secretspoc/svcc-secrets: secrets \\\"svcc-secrets\\\" is forbidden: User \\\"system:serviceaccount:secretspoc:kube-secrets-init\\\" cannot get resource \\\"secrets\\\" in API group \\\"\\\" in the namespace \\\"secretspoc\\\"\"}}}") has prevented the request from succeeding
Warning FailedCreate 30s (x5 over 66s) replicaset-controller (combined from similar events): Error creating: Internal error occurred: failed calling webhook "pods.kube-secrets-init.admission.doit-intl.com": failed to call webhook: an error on the server ("{\"kind\":\"AdmissionReview\",\"apiVersion\":\"admission.k8s.io/v1beta1\",\"response\":{\"uid\":\"e5d08f29-bd31-40ca-9c58-d2c027f5472f\",\"allowed\":false,\"status\":{\"metadata\":{},\"status\":\"Failure\",\"message\":\"could not mutate object: failed to mutate pod: : failed to mutate containers for pod : failed to look for envFrom: failed to get secret secretspoc/svcc-secrets: failed to get secret secretspoc/svcc-secrets: secrets \\\"svcc-secrets\\\" is forbidden: User \\\"system:serviceaccount:secretspoc:kube-secrets-init\\\" cannot get resource \\\"secrets\\\" in API group \\\"\\\" in the namespace \\\"secretspoc\\\"\"}}}") has prevented the request from succeeding
Expectations
It would be nice if the mutation would happen when references to GCP SM secrets are encountered, regardless of any errors related to kubernetes secret/configmap retrieval.
It would be really useful to provide better logging about the behaviour/events-flow of the kube-secrets-init.
The text was updated successfully, but these errors were encountered:
Environment configuration
0.5.0
0.5.0
0.9.3
get secrets
- due to security requirements, we denied this permissionfailurePolicy: Fail
debug
google
Test manifest
Problem
Because
kube-secret-init
cannot read any kubernetes secrets (as configured in the RBAC) and, the pod mutation is blocked regardless of:optional: true
set in the pod manifest (for bothenvFrom
andenv:secretKeyRef
)env:value
andconfigmaps
) referencing GCP SM secretsPlus, the logs of the
kube-secrets-init
are not specific about any of this. The only log line is:level=debug msg="no pod init containers were mutated"
.Only the ReplicaSet controller shows some information:
Expectations
kube-secrets-init
.The text was updated successfully, but these errors were encountered: