Advanced
Searching inInstall guides
How to search
  • Paste an error message in quotes, e.g. "permission denied", to find the fix table that explains it.
  • Choose an area and a part of the guide (install, first settings, daily use, security, fixes) to go straight to the right step.
  • "two words" finds the exact phrase.
  • Plain words find names, texts and examples.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search
Try:

Guide 57Istio · Kubernetes

Install and set up Istio (service mesh)

Istio is a service mesh: it adds encryption (mTLS), identity, access rules, traffic control (retries, timeouts, canaries) and detailed metrics between your services — without changing the app code. This guide installs Istio with istioctl, explains the two data planes (sidecars and ambient mode), turns on strict mTLS, writes authorization policies, routes traffic with a canary, and covers the checks and fixes.

  • 10 Lessons
  • 5 Commands

$ run as a normal user# run as root (or with sudo)

57.1

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.

ItemValue
CLIistioctl (in the Istio download)
Namespaceistio-system (istiod, ztunnel, CNI)
Sidecar modelabel a namespace istio-injection=enabled, then restart Pods
Ambient modelabel a namespace istio.io/dataplane-mode=ambient (no restart)
Main objectsPeerAuthentication, AuthorizationPolicy, VirtualService, DestinationRule (or Gateway API routes)
Add-onsKiali (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.

57.2

Install istioctl (RHEL and Ubuntu)

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.27.3 sh -
cd istio-1.27.3
export PATH=$PWD/bin:$PATH
install -m 0755 bin/istioctl /usr/local/bin/istioctl
istioctl version --remote=false
istioctl x precheck
✔ No issues found when checking the cluster. Istio is safe to install or upgrade!

57.3

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=ambient

Sidecar 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     Running

2/2 = the app container plus the Envoy sidecar.

57.4

First configuration: strict mTLS and access rules

Allow only encrypted, authenticated traffic in the mesh:

peer-authentication.yaml
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
  name: default
  namespace: istio-system
spec:
  mtls:
    mode: STRICT

Then deny by default in the namespace and allow only what is needed — here only the shop-web service account may call shop-api:

authz.yaml
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"]
SettingWhy
PeerAuthentication STRICT (mesh-wide)No plain-text traffic between services; every call has a verified identity.
Empty AuthorizationPolicy = deny allZero 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.

57.5

Traffic control: a canary

Send 10 % of traffic to version 2 (Gateway API style, works in both modes):

canary.yaml
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.

57.6

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 kiali

Real 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.

57.7

Make it safe

Security checklist:

  • Mesh-wide STRICT mTLS after a PERMISSIVE test phase.
  • Deny-all AuthorizationPolicy per 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 precheck first.
  • Egress control: register external services and limit outbound traffic where needed.

57.8

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.

57.9

Fix common problems

ProblemCauseFix
Pods show 1/1 — no sidecarNamespace not labelled, or Pods not restarted.kubectl label ns NS istio-injection=enabled; rollout restart.
503 with UF, URX or NR flags in Envoy logsUpstream 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 connectSTRICT mTLS.Add them to the mesh, or PERMISSIVE for that workload/port.
istioctl proxy-status shows STALEThe proxy does not get config from istiod.Check istiod logs and network policies to istiod:15012.
Init container errors / Pods stuck in sidecar modeiptables setup not allowed.Use the Istio CNI plugin (--set components.cni.enabled=true) or ambient mode.

57.10

Next steps

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.

All commands in this chapter