In this lesson you’ll install Istio into an existing Kubernetes cluster, deploy the Bookinfo sample application, and demonstrate both automatic namespace injection and manual (per-workload) injection of the Istio sidecar proxy. This guide follows a step-by-step flow:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Deploy the Bookinfo sample (pre-Istio).
- Install
istioctl. - Install the Istio control plane (demo profile).
- Enable automatic sidecar injection for a namespace.
- Manually inject the sidecar into an individual workload in an unlabeled namespace.
| Requirement | Why it matters |
|---|---|
A running Kubernetes cluster with kubectl configured | You need cluster access to deploy resources and inspect pods |
| Cluster privileges to install cluster components and label namespaces | Installing Istio and modifying namespace labels requires sufficient RBAC permissions |
Optional: Familiarity with Kubernetes kubectl basics | Helpful for troubleshooting and pod inspection |
1) Deploy the Bookinfo sample (pre-Istio)
First apply the Bookinfo sample so we have workloads to inject later. This deploys several microservices into thedefault namespace.
default:
details):
2) Install istioctl (download the client)
Check whetheristioctl is already present:
istioctl binary directory to your PATH (adjust the path as needed for your user/home location):
istioctl is available. At this point it will typically show a client version and note that Istio is not installed in-cluster:
3) Install Istio control plane (demo profile)
Install the Istio control plane into your cluster using thedemo profile, which is suitable for learning and demos:
istio-system namespace:
istiod-..., istio-ingressgateway-..., and istio-egressgateway-....
4) Enable automatic sidecar injection for a namespace
Useistioctl analyze to surface common configuration hints. For example, analyze the default namespace:
default):
2/2 (application container + istio-proxy):
istio-proxy container:
5) Manual (per-workload) injection into an unlabeled namespace
Automatic namespace injection is convenient, but there are cases where you want to inject only specific workloads within a namespace. Manual injection—by annotating the pod or deployment manifest—lets you do that without labeling the namespace. Create a new namespace nameddb (do not label it for injection):
redis-no-proxy running with only one container (no istio-proxy).
Analyze the namespace to confirm it’s not enabled for injection:
sidecar.istio.io/inject: "true" to that pod or deployment. A simple way is to create the pod manifest locally and apply it.
Create a pod manifest using a dry-run:
pod.yaml and add the injector annotation under metadata, for example:
db:
redis-no-proxywith1/1(application container only)redis-istio-proxywith2/2(application container +istio-proxy)
Automatic namespace injection (labeling the namespace) is the simpler and recommended approach for most environments. Use the annotation
sidecar.istio.io/inject: "true" when you need to inject only specific workloads in an otherwise unlabeled namespace. Note: some legacy helpers such as istioctl kube-inject have been deprecated or removed in recent Istio releases, so prefer annotation-based injection or istioctl-based installation workflows.Quick reference: common commands
| Task | Command | |
|---|---|---|
| Apply Bookinfo sample | kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.11/samples/bookinfo/platform/kube/bookinfo.yaml | |
| Check pods | kubectl get pods | |
| Describe pod | kubectl describe pod <pod-name> | |
| Download Istio | `curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.26.3 sh -` |
| Add istioctl to PATH | export PATH="$PATH:/root/istio-1.26.3/bin" | |
| Install Istio (demo) | istioctl install --set profile=demo -y | |
| Analyze namespace | istioctl analyze -n <namespace> | |
| Label namespace for injection | kubectl label namespace default istio-injection=enabled --overwrite | |
| Restart deployments to inject | kubectl rollout restart deployment <deployment-name> | |
| Create namespace | kubectl create ns db | |
| Create pod manifest with dry-run | kubectl run redis-istio-proxy --image=redis -n db --dry-run=client -o yaml > pod.yaml | |
| Apply manifest | kubectl apply -f pod.yaml |
Summary
- Installed
istioctl(client v1.26.3) and the Istio control plane using thedemoprofile. - Deployed the Bookinfo sample before installing Istio to illustrate pre- and post-injection behavior.
- Enabled automatic sidecar injection by labeling a namespace, then restarted specific workloads to have the
istio-proxyinjected. - Demonstrated manual, per-workload injection by annotating a pod manifest so the admission webhook would add the sidecar in an otherwise unlabeled namespace.
- Istio Documentation — Install Istio
- Istio Download Page / istioctl
- Bookinfo sample (Istio repo)
- Kubernetes Basics