An iGaming and crypto company was preparing a regulated launch in New Jersey. The state’s gaming rules (N.J.A.C. 13:69O and the GLI-19 standard for interactive gaming systems) required a zero-trust service mesh, and that project had been blocked for a year and a half. Our lead engineer, Mher Poghosyan, was transferred to the team to deliver it. He ran the proof of concept and the validation plan and, as the core implementation engineer, delivered the mesh on EKS in 3 months.
This article walks through the design: why Istio ambient mode, how traffic gets in and out, why default-deny needs a rollout plan, and how the mesh became a building block that any team turns on in about 10 minutes, without changing application code.
What zero trust means in practice
For an audit, the words have to become properties you can check:
- Every connection between services is encrypted and mutually authenticated.
- Every workload has a cryptographic identity, not just an IP address.
- Nothing is allowed unless a policy explicitly allows it.
- The rules live in git, so you can show who changed what and when.
Istio covers the first three with mTLS, SPIFFE identities and authorization policies. A workload’s identity comes from its Kubernetes service account, for example spiffe://cluster.local/ns/payments/sa/payments-api. The fourth point is GitOps.
Start with a validation plan
A mesh project that stalls for a long time rarely lacks engineers. More often nobody has written down what “done” means, so every discussion about tools starts from zero. Here the work started with a PoC and a validation plan: a list of claims, each with a test that proves it.
For a mesh like this, the list looks roughly like this:
- Plaintext from outside the mesh to a meshed service is rejected.
- A meshed workload without an allow rule cannot reach other services.
- An allowed call works, and L7 rules (method, path) are enforced where they are configured.
- A call to an external host that is not on the allowlist fails.
- Certificates rotate on their own, without restarts.
- You know what happens to traffic during a ztunnel restart or an Istio upgrade.
- The latency overhead is measured, not guessed.
Each item is a command someone else can repeat:
# A pod outside the mesh must not reach a meshed service in plaintext
kubectl create namespace mesh-test
kubectl run probe -n mesh-test --rm -it --restart=Never --image=curlimages/curl \
--command -- curl -sS -m 5 http://payments-api.payments:8080/healthz
# expected: the connection is reset
This changes the conversation. “Is the mesh ready?” becomes “which test fails?”, and the passing tests double as evidence for the auditors.
Why ambient mode
Classic Istio adds an Envoy sidecar to every pod. Ambient mode splits the data plane in two:
- ztunnel, a small proxy on every node (a DaemonSet), handles L4: mTLS, identities and L4 authorization.
- Waypoints are optional Envoy proxies for a namespace or a service. They add L7 features such as HTTP routing, L7 authorization and tracing, only where you ask for them.
For a mesh that has to cover every team, this matters more than it seems:
- No sidecar injection. A namespace joins the mesh with a label, and running pods do not even restart. With sidecars, every team restarts its workloads and often fixes side effects: startup order, Jobs that never finish because the sidecar keeps running, init containers that need the network.
- Lower overhead. One ztunnel per node instead of one Envoy per pod.
- Simpler upgrades. Upgrading the data plane does not mean restarting every application.
- L7 only where needed. Most service-to-service traffic needs encryption and identity, not HTTP rules.
The trade-offs are real: ambient is younger than sidecars, some features work only through a waypoint, and ztunnel is a per-node component, so a problem with it affects every meshed pod on that node. That is exactly what the validation plan is for.
kubectl label namespace payments istio.io/dataplane-mode=ambient
istioctl waypoint apply -n payments --enroll-namespace # only if this namespace needs L7
Calico runs underneath and adds L3/L4 network policy, which also covers pods outside the mesh. One pitfall when you combine the two: in ambient mode, meshed traffic arrives at the destination pod on port 15008 (HBONE), and kubelet health probes come from 169.254.7.127. A NetworkPolicy that does not allow both breaks traffic that looks unrelated.
How traffic gets in and out
The ingress controller was replaced with Gateway API gateways for four kinds of traffic:
- public traffic, behind Cloudflare;
- cross-account traffic from other AWS accounts, arriving over Transit Gateway;
- the platform’s own web UIs;
- egress to external services.
Keeping these on separate gateways means separate exposure, certificates and policies, so a mistake in one does not open the others. A public gateway and a team’s route:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: public
namespace: istio-ingress
spec:
gatewayClassName: istio
listeners:
- name: https
hostname: "*.example.com"
port: 443
protocol: HTTPS
tls:
mode: Terminate
certificateRefs:
- name: wildcard-example-com
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
gateway.example.com/public: "true"
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: web
namespace: web
spec:
parentRefs:
- name: public
namespace: istio-ingress
hostnames: ["app.example.com"]
rules:
- backendRefs:
- name: web
port: 8080
allowedRoutes matters: without it, any namespace could attach a route to the public gateway. Certificates come from Let’s Encrypt for public names and from an internal CA for internal ones. Egress follows the same principle as inbound traffic: the external hosts the platform may call are listed explicitly, and everything else is blocked.
STRICT mTLS and default-deny without an outage
The target state is two small policies in the Istio root namespace:
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: istio-system
spec:
mtls:
mode: STRICT # no plaintext anywhere in the mesh
---
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
name: allow-nothing
namespace: istio-system
spec: {} # allows nothing, so everything is denied
Applied on day one, they break things nobody listed: metrics scraping, gateways calling backends, CronJobs, forgotten cross-namespace calls, admission webhooks called by the Kubernetes API server, which is not in the mesh. Each of these fails the moment the policy lands. It is also easy to miss that in Istio the first ALLOW policy on a workload already denies everything else to it. Adding an allow rule is enforcement too.
So default-deny needs a rollout plan. The order we recommend:
- Enroll namespaces with no deny rules and mTLS in PERMISSIVE mode. Watch real traffic in Kiali long enough to see nightly and weekly jobs.
- Write allow rules from what you observed, per namespace, in git.
- Turn on a namespace-level
allow-nothingin stage, run the validation tests, then repeat in production. - When every namespace has its rules, switch on mesh-wide STRICT and
allow-nothing. - Keep rollback cheap: a policy is a file in git, and reverting it is one merge.
Allow rules use identities, not IPs. This one lets only the API’s service account call the payments service on one port, and ztunnel enforces it without any waypoint:
apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
name: payments-api
namespace: payments
spec:
selector:
matchLabels:
app: payments-api
action: ALLOW
rules:
- from:
- source:
principals: ["cluster.local/ns/api/sa/api"]
to:
- operation:
ports: ["8080"]
One trap specific to ambient: when a namespace uses a waypoint, the destination’s ztunnel sees the waypoint as the caller. L4 rules on the destination must allow the waypoint’s identity, and the per-client rules move to an L7 policy attached to the waypoint.
A building block, not a project per team
The other reason such projects stall is that every team gets its own mesh migration. Here the mesh was packaged once, as a self-service building block:
- Terraform behind one feature flag installs the mesh layer into a team’s cluster.
- Four Helm charts delivered by Argo CD cover what teams change: authorization policies, Gateway API routes, the egress allowlist, and certificates from Let’s Encrypt and the internal CA.
The flag pattern itself is simple (the names here are illustrative):
variable "service_mesh_enabled" {
type = bool
default = false
}
resource "helm_release" "ztunnel" {
count = var.service_mesh_enabled ? 1 : 0
name = "ztunnel"
repository = "https://istio-release.storage.googleapis.com/charts"
chart = "ztunnel"
version = var.istio_version
namespace = "istio-system"
}
With that in place, a team enables the mesh in about 10 minutes, with no application code changes. In a setup like this, that means turning on the flag, filling in values for routes, allow rules and egress hosts, and merging; Argo CD does the rest.
Application code stays the same, but Helm charts usually need work, and all existing charts were reworked for the mesh. Typical changes in such a rework:
- A service account per workload. Identity is the service account. If every Deployment in a namespace runs as
default, they share one identity, and policies cannot tell them apart. - HTTPRoutes instead of Ingress objects.
- Port names or
appProtocolon Services, so Istio knows which traffic is HTTP.
Observability and handover
A mesh you cannot see into gets blamed for every outage. The building block came with:
- Kiali with SSO for the live traffic graph and policy checks. Kiali supports OpenID Connect, so access goes through the company login, not a shared token.
- Istio dashboards in Grafana for request rates, errors and latency per workload.
- Jaeger tracing. In ambient mode, spans come from gateways and waypoints; ztunnel works at L4 and does not create them. For end-to-end traces, applications still have to pass trace headers along.
- Alerts with runbooks, so whoever sees an alert first knows where to look.
Mher wrote the HOWTO and handed the building block over to the platform team. A mesh that only one engineer understands is a risk, not a deliverable.
Checklist
- A validation plan with a runnable test for every claim, agreed before the build
- Ambient mode by default; waypoints only where L7 is needed
- NetworkPolicy allows HBONE on port 15008 and probes from
169.254.7.127 - Separate gateways for public, cross-account, platform and egress traffic
- One service account per workload
- Default-deny rolled out namespace by namespace, stage first, mesh-wide last
- One feature flag and a few charts, so teams enable the mesh without a project
- Kiali, dashboards, tracing, alerts and runbooks before handover
If a security or compliance requirement has been stuck on your roadmap for months, tell us what is in the way.
