Enabling automatic sidecar injection allows istiod
to watch all Pod creation operations on all namespaces, which should be part of the Istio service mesh, and inject the newly created Pods with a sidecar proxy.
You can enable sidecar proxy injection for either an entire namespace or a single Deployment. If the sidecar proxy injection is disabled at the namespace level, or the sidecar.istio.io/inject
label on a Pod is set to false
, the sidecar proxy is not injected.
Note
Adding the istio-injection=enabled
label on the namespace level results in injecting sidecars to all Pods inside of the namespace.
-
To enable sidecar proxy injection for a namespace, you can use either kubectl or Kyma dashboard:
Use the following command:
kubectl label namespace {YOUR_NAMESPACE} istio-injection=enabled
-
To enable sidecar proxy injection for a Pod, you can use either kubectl or Kyma dashboard:
Use the following command:
kubectl patch -n {YOUR_NAMESPACE} deployments/{YOUR_DEPLOYMENT} -p '{"spec":{"template":{"metadata":{"labels":{"sidecar.istio.io/inject":"true"}}}}}'