Skip to content

Deploying Istio service mesh in ambient mode on Kubernetes 1.30

Full Istio installer in ambient mode — ztunnel L4 mesh, waypoint proxies for L7 policy, no sidecars injected into workloads, sample app verified end to end.

You bought into a service mesh two years ago for mTLS between workloads and a coherent story for retries and timeouts. The mesh worked. The sidecar injection broke a release every six weeks — a workload that doesn’t expect a process in its pod, a startup race where the app comes up before envoy is ready, a memory baseline that grew by 40-150 MB per pod just to terminate TLS. You spent enough on platform engineering keeping sidecars happy that you started asking whether the mesh was earning its keep. Istio ambient mode is the answer the project shipped in response: keep mTLS and L4 policy at the node (ztunnel runs as a DaemonSet, not a sidecar), opt into L7 features (HTTP routing, JWT, rate limiting) only for the namespaces that need them via a single waypoint proxy per namespace. No injection into application pods, no per-workload memory tax, and the mesh stays a platform concern.

What’s happening

Classic Istio (the “sidecar” mode that has been the default since 2018) gives every pod its own envoy proxy. That proxy intercepts every byte of traffic to and from the workload via iptables redirection and applies mTLS, policy, telemetry, the entire mesh feature set. The model is consistent and powerful, and the operational burden of injecting and lifecycling thousands of envoy sidecars is what most teams underestimate. Ambient mode splits the mesh into two layers. The secure overlay (ztunnel, a Rust DaemonSet) handles mTLS, mutual auth, and L4 policy between pods — it shares the node kernel namespace, intercepts pod traffic in CNI hooks, and terminates HBONE (HTTP-Based Overlay Network Environment) tunnels between nodes. Application pods are not modified. For L7 features you opt in per-namespace by deploying a waypoint proxy — an envoy that handles HTTP routing, JWT validation, request retries, and so on for traffic into that namespace. Namespaces without a waypoint get only the L4 layer. The trade-off: a waypoint proxy is a separate hop, so the L7 path is slightly longer than sidecar mode; the L4 path is significantly cheaper. For most teams the L4 layer is what they actually needed all along.

How to verify

Check cluster version (ambient is stable starting 1.22, recommended 1.23+ on Kubernetes 1.27+):

kubectl version --short
istioctl version 2>/dev/null || echo "istioctl not yet installed"

If sidecar Istio is already running, that’s a separate migration:

kubectl get ns -L istio-injection
kubectl -n istio-system get pods

Confirm a CNI is in place. Ambient works with Calico, Cilium, flannel, kube-router — but the CNI plugin chain has to allow Istio to install its own redirect. Inspect /etc/cni/net.d/ on a node:

ls /etc/cni/net.d/
cat /etc/cni/net.d/*.conflist

Look for name fields you can identify; you’ll want them in cniConfDir/cniBinDir settings in the istioctl install profile if your cluster diverges from defaults.

The fix

The script installs istioctl, deploys Istio in ambient profile (--set profile=ambient), labels two test namespaces as istio.io/dataplane-mode: ambient, deploys a sample workload, exercises the ztunnel L4 path, deploys a waypoint proxy for the second namespace, applies an AuthorizationPolicy enforced at L7, and runs a verification matrix.

#!/usr/bin/env bash
set -euo pipefail

### Istio 1.23 ambient-mode installer for Kubernetes 1.30
### Run from any control-plane node OR a workstation with kubectl context set
### Idempotent for the install step; reruns won't break anything

if ! command -v kubectl >/dev/null; then
  echo "kubectl not found."
  exit 1
fi

# === EDIT BEFORE RUNNING ===
ISTIO_VERSION="1.23.2"
WORK_DIR="/opt/istio"
PROFILE="ambient"
# ===========================

echo "==> Verifying cluster reachable"
kubectl cluster-info

if kubectl -n istio-system get deploy istiod >/dev/null 2>&1; then
  echo "ERROR: an existing Istio install was detected in istio-system."
  echo "       Inspect with: kubectl -n istio-system get all"
  echo "       This script installs fresh — uninstall first or migrate separately."
  exit 1
fi

echo "==> Downloading istioctl ${ISTIO_VERSION}"
mkdir -p "${WORK_DIR}"
cd "${WORK_DIR}"
curl -L "https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux-amd64.tar.gz" \
  -o istio.tar.gz
tar xzf istio.tar.gz
rm istio.tar.gz
install -m 0755 "istio-${ISTIO_VERSION}/bin/istioctl" /usr/local/bin/istioctl
istioctl version --remote=false

echo "==> Running install precheck"
istioctl x precheck

echo "==> Installing Istio in ambient mode"
istioctl install \
  --set profile="${PROFILE}" \
  --set values.cni.cniConfDir=/etc/cni/net.d \
  --set values.cni.cniBinDir=/opt/cni/bin \
  --set "components.ingressGateways[0].enabled=false" \
  -y

echo "==> Waiting for core components"
kubectl -n istio-system rollout status deployment/istiod --timeout=180s
kubectl -n istio-system rollout status daemonset/istio-cni-node --timeout=180s
kubectl -n istio-system rollout status daemonset/ztunnel --timeout=180s

echo "==> Verifying ztunnel reachable on every node"
ZT_PODS=$(kubectl -n istio-system get pod -l app=ztunnel -o name | wc -l)
NODES=$(kubectl get nodes --no-headers | wc -l)
echo "    nodes=${NODES}  ztunnel-pods=${ZT_PODS}"
if [[ "${ZT_PODS}" -ne "${NODES}" ]]; then
  echo "    WARNING: ztunnel DaemonSet pod count != node count"
fi

echo
echo "----------------------------------------"
echo "Demo: deploying sample workloads"
echo "----------------------------------------"

echo "==> Creating ns 'shop-l4' (ambient, no waypoint) and 'shop-l7' (ambient + waypoint)"
kubectl create ns shop-l4 --dry-run=client -o yaml | kubectl apply -f -
kubectl create ns shop-l7 --dry-run=client -o yaml | kubectl apply -f -
kubectl label ns shop-l4 istio.io/dataplane-mode=ambient --overwrite
kubectl label ns shop-l7 istio.io/dataplane-mode=ambient --overwrite

echo "==> Deploying sample workloads"
cat <<EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
metadata: { name: api, namespace: shop-l4 }
spec:
  replicas: 1
  selector: { matchLabels: { app: api } }
  template:
    metadata: { labels: { app: api } }
    spec:
      containers:
        - name: api
          image: hashicorp/http-echo:1.0.0
          args: ["-text=hello-from-api-l4"]
          ports: [{ containerPort: 5678 }]
---
apiVersion: v1
kind: Service
metadata: { name: api, namespace: shop-l4 }
spec:
  selector: { app: api }
  ports: [{ port: 80, targetPort: 5678 }]
---
apiVersion: apps/v1
kind: Deployment
metadata: { name: web, namespace: shop-l7 }
spec:
  replicas: 1
  selector: { matchLabels: { app: web } }
  template:
    metadata: { labels: { app: web } }
    spec:
      containers:
        - name: web
          image: hashicorp/http-echo:1.0.0
          args: ["-text=hello-from-web-l7"]
          ports: [{ containerPort: 5678 }]
---
apiVersion: v1
kind: Service
metadata: { name: web, namespace: shop-l7 }
spec:
  selector: { app: web }
  ports: [{ port: 80, targetPort: 5678 }]
EOF

kubectl -n shop-l4 wait --for=condition=available deploy/api --timeout=60s
kubectl -n shop-l7 wait --for=condition=available deploy/web --timeout=60s

echo "==> L4 ambient path check (no waypoint, mTLS-only)"
kubectl run -n shop-l4 --rm -i --restart=Never \
  --image=curlimages/curl curl-test -- curl -s -m 5 http://api/ \
  || echo "Curl exited; see above"

echo "==> Creating waypoint proxy for shop-l7"
istioctl waypoint apply -n shop-l7 --enroll-namespace --wait

echo "==> Verifying waypoint pod ready"
kubectl -n shop-l7 get pod -l service.istio.io/canonical-name=waypoint

echo "==> Applying L7 AuthorizationPolicy: allow only GET / from same namespace"
cat <<'EOF' | kubectl apply -f -
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
  name: web-get-only
  namespace: shop-l7
spec:
  targetRefs:
    - kind: Service
      group: ""
      name: web
  rules:
    - to:
        - operation:
            methods: ["GET"]
            paths: ["/"]
      from:
        - source:
            namespaces: ["shop-l7"]
EOF

echo "==> Testing L7 path: GET / from shop-l7 should succeed"
kubectl run -n shop-l7 --rm -i --restart=Never \
  --image=curlimages/curl curl-allowed -- curl -s -m 5 http://web/ \
  || echo "Curl exited (allowed path); see above"

echo "==> Testing L7 path: POST / from shop-l7 should be denied"
set +e
kubectl run -n shop-l7 --rm -i --restart=Never \
  --image=curlimages/curl curl-denied -- \
  curl -s -m 5 -o /dev/null -w "%{http_code}" -X POST http://web/
RC=$?
set -e
echo

echo "==> Testing cross-namespace from shop-l4 to shop-l7 web (should be denied)"
set +e
kubectl run -n shop-l4 --rm -i --restart=Never \
  --image=curlimages/curl curl-cross -- \
  curl -s -m 5 -o /dev/null -w "%{http_code}" "http://web.shop-l7.svc.cluster.local/"
RC2=$?
set -e
echo

echo
echo "========================================"
echo "Istio ambient install + sample app done"
echo "========================================"
echo
echo "Inspect ztunnel:"
echo "  kubectl -n istio-system logs -l app=ztunnel --tail=20"
echo
echo "Inspect waypoint:"
echo "  kubectl -n shop-l7 logs -l service.istio.io/canonical-name=waypoint --tail=20"
echo
echo "List ambient namespaces:"
echo "  kubectl get ns -L istio.io/dataplane-mode"
echo
echo "Onboarding more namespaces (L4 only):"
echo "  kubectl label ns <name> istio.io/dataplane-mode=ambient"
echo
echo "Add a waypoint to a namespace (L7):"
echo "  istioctl waypoint apply -n <name> --enroll-namespace --wait"
echo
echo "Cleanup demo (optional):"
echo "  kubectl delete ns shop-l4 shop-l7"

Make it executable and run:

chmod 700 /root/install-istio-ambient.sh
/root/install-istio-ambient.sh

The verification matrix at the end of the script tells you four things you need to confirm. ztunnel runs on every node (ZT_PODS == NODES). The L4 ambient path works — pods in shop-l4 can reach api over the mesh without any waypoint deployed. The L7 path works — pods in shop-l7 can reach web through the waypoint and the GET is allowed. The L7 enforcement works — POST returns 403 and the cross-namespace curl from shop-l4 is denied. The most common first-deploy issue is the CNI chain: if istio-cni-node is in CrashLoopBackOff, your CNI is using a custom config directory and the cniConfDir/cniBinDir flags need to match. The second most common is workloads coming up before the namespace is labeled — Istio doesn’t retroactively redirect existing connections; restart the workload after labeling. The third is migrating from sidecar mode — you cannot run both modes against the same workload simultaneously; migrate one namespace at a time, removing the injection label as you add the ambient label.

We run Istio meshes on our managed cloud compute and PaaS tiers under Managed Cloud Ops with upgrades, ztunnel/waypoint scaling, and policy auditing handled in our monitoring plane — start a scoping call when you want the mesh to stop being a part-time job.