A webhook fails with `failed calling webhook ... tls: failed to verify certificate: x509: certificate signed by unknown authority`.
IntermediateTroubleshootingControl plane, RBAC, webhooks and autoscaling
Answer
Likely causes → The caBundle in the webhook configuration does not match the CA that signed the webhook server's certificate: cert rotated but caBundle not updated, cert-manager CA injector not running, or the configuration was applied from a stale manifest that overwrote the injected bundle.
Diagnose →
kubectl get validatingwebhookconfiguration my-webhook -o jsonpath='{.webhooks[0].clientConfig.caBundle}' | base64 -d | openssl x509 -noout -subject -enddate
kubectl get secret my-webhook-tls -n my-ns -o jsonpath='{.data.ca\.crt}' | base64 -d | openssl x509 -noout -subject -enddate
kubectl get pods -n cert-manager -l app.kubernetes.io/component=cainjector
Fix → Let cainjector manage the bundle (cert-manager.io/inject-ca-from: my-ns/my-webhook-cert annotation) and make GitOps ignore the caBundle field.
Prevent → Never hard-code caBundle in Git; add ignoreDifferences in Argo CD for injected fields.
More on Control plane, RBAC, webhooks and autoscaling
A developer gets `Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "payments"`.BeginnerA CI pipeline fails with `deployments.apps "api" is forbidden: User "system:serviceaccount:ci:deployer" cannot patch resource "deployments" in API group "apps" in the namespace "prod"`.BeginnerA user can `get pods` but `kubectl logs` fails with `cannot get resource "pods/log"` and `kubectl exec` fails with `cannot create resource "pods/exec"`.BeginnerCreating a RoleBinding fails with `is attempting to grant RBAC permissions not currently held`.IntermediateEvery `kubectl apply` fails with `Internal error occurred: failed calling webhook "validate.kyverno.svc-fail": failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/validate/fail?timeout=10s": context deadline exceeded`.AdvancedCreating a Certificate fails with `failed calling webhook "webhook.cert-manager.io": ... no endpoints available for service "cert-manager-webhook"`.Intermediate