$ run as a normal user# run as root (or with sudo)
Know it before you install
istiod (control plane) gives every workload a certificate (SPIFFE identity) and the routing config. The data plane carries the traffic: either an Envoy sidecar in each Pod, or ambient mode (a node agent ztunnel for mTLS, and optional waypoint proxies for L7 rules) — no sidecars to inject.
| Item | Value |
|---|---|
| CLI | istioctl (in the Istio download) |
| Namespace | istio-system (istiod, ztunnel, CNI) |
| Sidecar mode | label a namespace istio-injection=enabled, then restart Pods |
| Ambient mode | label a namespace istio.io/dataplane-mode=ambient (no restart) |
| Main objects | PeerAuthentication, AuthorizationPolicy, VirtualService, DestinationRule (or Gateway API routes) |
| Add-ons | Kiali (graph), Prometheus, Grafana, Jaeger (in samples/addons/) |
What you need: Kubernetes (a supported version for your Istio release), 4 CPU / 8 GB free for a lab, and kubectl admin access.
Install istioctl (RHEL and Ubuntu)
Install the mesh
Ambient mode (recommended for new meshes — less overhead, no sidecars):
istioctl install --set profile=ambient --skip-confirmation
kubectl -n istio-system get pods
istiod-… 1/1 Running
istio-cni-node-… 1/1 Running
ztunnel-… 1/1 Running
kubectl label namespace shop istio.io/dataplane-mode=ambientSidecar mode (the classic way, needed for some features):
istioctl install --set profile=default --skip-confirmation
kubectl label namespace shop istio-injection=enabled
kubectl -n shop rollout restart deploy
kubectl -n shop get pods
NAME READY STATUS
shop-api-7c9… 2/2 Running2/2 = the app container plus the Envoy sidecar.
First configuration: strict mTLS and access rules
Allow only encrypted, authenticated traffic in the mesh:
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: istio-system
spec:
mtls:
mode: STRICTThen deny by default in the namespace and allow only what is needed — here only the shop-web service account may call shop-api:
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
name: deny-all
namespace: shop
spec: {}
---
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
name: api-from-web
namespace: shop
spec:
selector:
matchLabels: { app: shop-api }
action: ALLOW
rules:
- from:
- source:
principals: ["cluster.local/ns/shop/sa/shop-web"]| Setting | Why |
|---|---|
PeerAuthentication STRICT (mesh-wide) | No plain-text traffic between services; every call has a verified identity. |
Empty AuthorizationPolicy = deny all | Zero trust: nothing is allowed until you say so. |
principals (service accounts) | Rules by identity, not by IP address. |
kubectl apply -f peer-authentication.yaml -f authz.yaml
istioctl analyze -n shop
✔ No validation issues found when analyzing namespace: shop.Watch out
Turn on STRICT only when every client of those services is in the mesh — clients outside the mesh can no longer connect. Start with PERMISSIVE, check, then switch. In ambient mode, HTTP-level rules (paths, methods) need a waypoint proxy: istioctl waypoint apply -n shop --enroll-namespace.
Traffic control: a canary
Send 10 % of traffic to version 2 (Gateway API style, works in both modes):
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: shop-api
namespace: shop
spec:
parentRefs:
- group: ""
kind: Service
name: shop-api
port: 8080
rules:
- backendRefs:
- name: shop-api-v1
port: 8080
weight: 90
- name: shop-api-v2
port: 8080
weight: 10
timeouts:
request: 5s(The classic Istio way is a VirtualService + DestinationRule with subsets.) Add retries and outlier detection for resilience.
Daily use: the commands and the real uses
istioctl proxy-status
istioctl analyze -A
istioctl x describe pod shop-api-7c9d8-abcde -n shop
istioctl proxy-config routes deploy/shop-web -n shop
istioctl ztunnel-config workloads
kubectl apply -f samples/addons/prometheus.yaml -f samples/addons/kiali.yaml
istioctl dashboard kialiReal uses at work:
- mTLS everywhere for compliance (encrypt traffic inside the cluster) without app changes.
- Zero-trust access rules between services by identity.
- Canary releases, retries, timeouts and a live service graph (Kiali) with golden metrics.
Make it safe
Security checklist:
- Mesh-wide
STRICTmTLS after aPERMISSIVEtest phase. - Deny-all
AuthorizationPolicyper namespace + explicit allows by service account. - One service account per workload (identities are only useful when they are specific).
- Protect
istio-system; only platform admins change mesh-wide policies. - Keep Istio on a supported version (upgrade with revisions / canary control planes); run
istioctl x precheckfirst. - Egress control: register external services and limit outbound traffic where needed.
Update and remove
istioctl x precheck
istioctl upgrade --skip-confirmation
kubectl -n shop rollout restart deploy
istioctl uninstall --purge --skip-confirmation
kubectl delete namespace istio-system(Sidecar mode needs a Pod restart to get the new proxy version.) For production, use revision-based canary upgrades — see the Istio upgrade guide.
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
Pods show 1/1 — no sidecar | Namespace not labelled, or Pods not restarted. | kubectl label ns NS istio-injection=enabled; rollout restart. |
503 with UF, URX or NR flags in Envoy logs | Upstream down, retries exhausted, or no route. | istioctl proxy-config routes …; check Service ports are named/appProtocol set. |
RBAC: access denied (403) | An AuthorizationPolicy blocks the call. | Check principals and the service account of the caller. |
| Clients outside the mesh can not connect | STRICT mTLS. | Add them to the mesh, or PERMISSIVE for that workload/port. |
istioctl proxy-status shows STALE | The proxy does not get config from istiod. | Check istiod logs and network policies to istiod:15012. |
| Init container errors / Pods stuck in sidecar mode | iptables setup not allowed. | Use the Istio CNI plugin (--set components.cni.enabled=true) or ambient mode. |
Next steps
- Command page: istioctl.
- At work: Istio — a service mesh.
- The edge in front of the mesh: Gateway API. Watch it: Prometheus, Grafana.
- Network policies (L3/L4) next to the mesh: CKA — Network policies.
1What does PeerAuthentication with mode: STRICT do?
Services accept only mTLS traffic from workloads in the mesh.
2In ambient mode, what do you need for HTTP path rules?
A waypoint proxy (istioctl waypoint apply), because ztunnel works only at L4.