Skip to content

Manual sidecar injection with istioctl

In environments where is not enabled, the istioctl CLI tool provides a mechanism to manually inject the Istio sidecar proxy into application deployments.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__sleep__README.md] This process involves modifying the application's deployment configuration locally before applying it to the cluster, ensuring that the necessary Envoy proxy containers are included alongside the application container.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__sleep__README.md]

Usage

The primary command for manual injection is istioctl kube-inject.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__sleep__README.md]

When deploying a resource, such as a deployment defined in sleep.yaml, you pipe the file contents through istioctl before applying them to the cluster^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__sleep__README.md]:

[kubectl](<./kubectl.md>) apply -f <([istioctl](<./istioctl.md>) kube-inject -f sleep.yaml)

This command instructs istioctl to read the configuration from sleep.yaml, inject the sidecar configuration into it, and output the modified YAML, which is then immediately applied by kubectl^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__sleep__README.md].

Sources

  • 400-devops__07-Monitoring-and-Observability__k8s-istio__samples__sleep__README.md