Istio Sidecar Injection (istioctl kube-inject)¶
Istio sidecar injection is the manual process of modifying a Kubernetes resource definition to include the necessary Istio sidecar proxy configuration before it is applied to the cluster.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__tcp-echo__README.md]
This functionality is typically utilized when a user wishes to deploy a workload into the Istio Service mesh immediately, without relying on the cluster's automatic injection mechanisms or webhook configurations.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__tcp-echo__README.md]
Usage¶
The istioctl kube-inject command fetches the resource configuration, injects the sidecar proxy configuration into it, and outputs the modified YAML.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__tcp-echo__README.md] In a standard shell environment, this output is often piped directly to kubectl apply for immediate deployment.^[400-devops__07-Monitoring-and-Observability__k8s-istio__samples__tcp-echo__README.md]
The command syntax is typically used as follows:
$ [kubectl](<./kubectl.md>) apply -f <([istioctl](<./istioctl.md>) kube-inject -f <resource-file.yaml>)
For example, to deploy a TCP echo service within the mesh:
$ [kubectl](<./kubectl.md>) apply -f <([istioctl](<./istioctl.md>) kube-inject -f tcp-echo.yaml)
service/tcp-echo created
deployment.extensions/tcp-echo created
Sources¶
- 400-devops__07-Monitoring-and-Observability__k8s-istio__samples__tcp-echo__README.md