The Istio sidecar proxy isn’t being injected because the Kubernetes admission controller responsible for this injection is either not running, not configured correctly, or is being blocked from intercepting the Pod creation requests.

Here’s a breakdown of common causes and how to fix them:

1. Admission Controller Not Enabled or Misconfigured

Istio relies on a ValidatingAdmissionWebhook and a MutatingAdmissionWebhook to inject the sidecar. If these aren’t set up correctly, injection will fail.

  • Diagnosis:
    • Check the istiod deployment: kubectl get deployment -n istio-system istiod -o yaml
    • Look for the ValidatingWebhookConfiguration and MutatingWebhookConfiguration in the output of kubectl get mutatingwebhookconfigurations,validatingwebhookconfigurations. Ensure they exist and have the correct clientConfig pointing to your istiod service.
    • Verify the failurePolicy is set to Ignore or Fail as intended. Ignore allows Pods to be created even if the webhook fails, which might mask injection issues. Fail is generally preferred for ensuring all Pods are processed by the webhook.
  • Fix:
    • If the webhooks are missing, re-apply the Istio operator or Helm chart with the correct configuration. For example, using Helm:
      helm upgrade --install istio-base istio/base -n istio-system -f values.yaml
      helm upgrade --install istiod istio/istiod -n istio-system -f values.yaml
      
      Ensure your values.yaml has pilot.webhook.mode: "validation,mutation" or similar, depending on your Istio version.
    • If the webhooks exist but are misconfigured (e.g., wrong service name or port), you’ll need to edit them:
      kubectl edit mutatingwebhookconfiguration istio-mutation-webhook
      kubectl edit validatingwebhookconfiguration istio-validation-webhook
      
      Update the clientConfig.service.name to istiod.istio-system.svc and clientConfig.service.port to 15017 (or your configured webhook port).
  • Why it works: The webhooks are the gatekeepers. When a Pod is created, Kubernetes asks these webhooks if they want to modify or validate it. If the webhooks aren’t registered or can’t reach istiod, they can’t perform the sidecar injection.

2. istiod Pod Not Running or Unhealthy

The istiod component is responsible for serving the admission webhooks. If istiod is down or unhealthy, the webhooks have no one to talk to.

  • Diagnosis:
    • Check the status of istiod pods: kubectl get pods -n istio-system -l app=istiod
    • If pods are not running or are in an error state, check their logs: kubectl logs <istiod-pod-name> -n istio-system
  • Fix:
    • If istiod pods are crashing, examine the logs for errors. Common causes include insufficient resources (CPU/memory) or misconfiguration in the istiod deployment itself.
    • If istiod is not running, try restarting the deployment: kubectl rollout restart deployment -n istio-system istiod
    • Ensure your Kubernetes cluster has sufficient resources to run istiod.
  • Why it works: istiod is the brain of Istio’s control plane. It handles the logic for sidecar injection and must be operational for the admission webhooks to function.

3. Network Connectivity Issues to istiod

The Kubernetes API server needs to be able to reach the istiod service on its webhook port (usually 15017) for the admission controller to work.

  • Diagnosis:
    • Check if istiod service is correctly configured: kubectl get svc -n istio-system istiod -o yaml
    • Verify that the ValidatingWebhookConfiguration and MutatingWebhookConfiguration point to the correct istiod service and port.
    • Attempt to curl istiod from a pod within the cluster (or the Kubernetes API server if you have access):
      # From a test pod in the cluster
      kubectl exec -it <your-test-pod> -- curl -k https://istiod.istio-system.svc:15017
      
      You should get a response, even if it’s an error indicating an incomplete request. A connection refused or timeout means a network issue.
  • Fix:
    • Ensure there are no NetworkPolicies in the istio-system namespace blocking traffic to the istiod service on port 15017.
    • Verify that your cluster’s CNI (Container Network Interface) is functioning correctly and that Pod-to-Pod communication within the cluster is working.
    • If using a service mesh that intercepts traffic (like another Istio installation or Consul), ensure it’s not interfering with the communication between the API server and istiod.
  • Why it works: The admission controller (running within the Kubernetes API server) sends requests to istiod. If network policies, CNI issues, or firewall rules prevent this communication, the injection request never reaches istiod.

4. Incorrect Namespace or Pod Labels

Istio’s sidecar injection is controlled by namespace-level labels or pod-level annotations. If these are not set correctly, Istio won’t attempt injection.

  • Diagnosis:
    • Check the namespace label: kubectl get namespace <your-namespace> -o yaml
    • Ensure the label istio-injection=enabled is present.
    • Check the Pod definition for annotations like sidecar.istio.io/inject: "true" or sidecar.istio.io/status: "injected".
  • Fix:
    • Add the namespace label: kubectl label namespace <your-namespace> istio-injection=enabled
    • If you want to inject into a specific pod and override the namespace setting, add the annotation to the Pod spec:
      apiVersion: v1
      kind: Pod
      metadata:
        name: my-pod
        annotations:
          sidecar.istio.io/inject: "true"
      spec:
        containers:
        - name: my-app
          image: nginx
      
    • If you want to exclude a specific pod from injection even if the namespace is enabled, use sidecar.istio.io/inject: "false" annotation.
  • Why it works: Istio uses these labels and annotations as explicit signals to trigger or suppress the sidecar injection process performed by the admission controller.

5. Admission Webhook Overrides or Conflicts

Other admission controllers or custom configurations might be interfering with Istio’s webhooks.

  • Diagnosis:
    • Examine the ValidatingWebhookConfiguration and MutatingWebhookConfiguration for any other webhooks that might be targeting the same resources (e.g., Pods in the istio-system namespace or your application namespaces).
    • Check the Kubernetes API server logs for any admission webhook errors.
  • Fix:
    • Carefully review the rules section of all webhook configurations. Ensure that Istio’s webhooks have the correct scope, apiGroups, apiVersions, and resources defined.
    • Adjust the namespaceSelector or objectSelector in other webhook configurations if they are too broad and inadvertently intercepting Istio’s webhook requests.
    • If there’s a direct conflict, you might need to reorder webhooks by adjusting the reinvocationPolicy or priority if supported by your Kubernetes version, though this is generally discouraged. It’s better to resolve the configuration overlap.
  • Why it works: Admission webhooks are processed in a specific order. If another webhook intercepts and modifies the Pod before Istio’s webhook sees it, or if a webhook rejects the Pod outright, Istio’s injection might not occur or might fail.

6. TLS/SSL Certificate Issues

The webhooks communicate with istiod over TLS. If the certificates are expired, misconfigured, or not trusted by the API server, the connection will fail.

  • Diagnosis:
    • Check the clientConfig.caBundle in your ValidatingWebhookConfiguration and MutatingWebhookConfiguration. It should contain the CA certificate that signed the istiod’s webhook server certificate.
    • Examine the logs of the Kubernetes API server for TLS handshake errors when communicating with the Istio webhooks.
    • Check the istiod logs for any errors related to its webhook server certificate.
  • Fix:
    • If certificates are expired or invalid, you often need to re-apply Istio or regenerate the certificates. For Helm installations, upgrading the Istio release usually handles certificate rotation.
    • Ensure the caBundle is correctly populated. This is typically managed by Istio itself, but manual interventions can break it.
    • If istiod is configured with a custom certificate, ensure it’s valid and trusted by the cluster.
  • Why it works: TLS is essential for secure communication. If the API server cannot establish a trusted TLS connection with istiod’s webhook endpoint, it will reject the webhook calls, preventing sidecar injection.

The next error you’ll likely hit after fixing sidecar injection issues is related to services not being discovered or traffic not being routed correctly within the mesh, because the sidecar is fundamental to those operations.

Want structured learning?

Take the full Istio course →