How to Encrypt Cluster Traffic With Istio mTLS on Kubernetes
Enforce mutual TLS across GridGain 8 cluster, thin-client, and external traffic with an Istio service mesh, without changing the cluster's own configuration.
Prerequisites
A running Kubernetes cluster with
kubectlaccess. The commands below were tested on kind. They apply unchanged to managed Kubernetes (EKS, GKE, AKS); only the external load balancer in the optional gateway step differs by platform.istioctl 1.20 or later (install guide).
GridGain 8 only: A GridGain Enterprise evaluation or commercial license file (
gridgain-license.xml) from gridgain.com/tryfree.
Overview
This guide encrypts every transport into and across a two-node cache cluster using an Istio service mesh: discovery and communication between nodes, thin-client connections, and external HTTP traffic. Istio wraps each connection in mutual TLS at the sidecar, so the cluster runs with no SSL configuration of its own and no keystores to manage.
The procedure runs against GridGain 8 Enterprise.
Two notes on the environment. This guide uses Kubernetes rather than the standard local Docker setup because a service mesh is a Kubernetes construct. It uses two cache nodes rather than one because the value of the mesh is encrypting the traffic between nodes, which only exists once a second node joins.
Install Istio
Install Istio with the default profile, which includes the ingress gateway used in the optional external-access step later.
istioctl install -yConfirm the control plane is running:
kubectl get pods -n istio-systemExpected output:
NAME READY STATUS RESTARTS AGE
istio-ingressgateway-5dcc6ff9cb-nspc9 1/1 Running 0 12m
istiod-54b5f6856c-fzkx6 1/1 Running 0 12mCreate the Namespace With Sidecar Injection
Istio injects an Envoy sidecar into every pod in a labeled namespace. Create the namespace and apply the label before deploying the cluster, so the cache pods start with their proxies already in place.
Verify the label:
Expected output:
Deploy the Two-Node Cluster
Deploy a two-node cluster configured for Istio. The manifests below define three objects: a ConfigMap holding the node configuration, a headless Service for peer discovery, and a StatefulSet running two cache nodes. Two details in these manifests are what make Istio work with a stateful cache cluster, and both are called out after the code.
GridGain 8 Enterprise requires a license. Create a Secret from your license file first:
Save the following as ignite-cluster.yaml. The node configuration adds the GridGain plugin pointing at the mounted license:
Apply the manifests:
Two lines in these manifests are specific to running under Istio:
name: tcp-communication(and the othertcp-port names) on the headless Service. Istio creates an outbound listener only for declared, named ports. Cache nodes discover each other by connecting directly to pod IPs through the headless Service, so without these named ports Istio has no listener for that traffic, it falls through to the PassthroughCluster as plaintext, and STRICT mTLS rejects it. Thetcp-prefix tells Istio to treat the port as opaque TCP rather than attempting HTTP parsing.holdApplicationUntilProxyStarts: truein the pod annotation. This delays the cache node until the Envoy proxy and its iptables rules are ready. Without it the JVM starts first, the first inter-node handshake fires before the proxy can route it, and the cluster stalls on partition-map-exchange warnings.
Wait for both pods to report 2/2 containers (the cache node plus the sidecar):
Both pods come up sequentially and settle at 2/2:
Enforce STRICT Mutual TLS
Sidecar injection alone permits mTLS but does not require it; nodes can still accept plaintext. A PeerAuthentication policy in STRICT mode closes that gap by rejecting any non-mTLS connection in the namespace.
Save the following as peer-authentication.yaml:
Apply it:
Scoping the policy to the ignite namespace keeps the rule contained. From this point, every connection between pods in the namespace must present a valid mesh-issued certificate.
Expose the External Client Over HTTPS (Optional)
Skip this step if you only need encryption inside the cluster. Complete it to terminate HTTPS for an external application, such as the Spring Boot thin client in the reference repository. The gateway terminates TLS at the mesh edge and re-wraps the in-cluster hop as mTLS, so the application needs no changes.
Generate a self-signed certificate and load it as a TLS secret in the gateway's namespace:
Save the following as ignite-client-gateway.yaml. It expects a Service named ignite-client on port 80 in the ignite namespace (deployed with the application):
Apply it:
Forward the ingress gateway's HTTPS port and call the application:
In a second terminal:
Expected output (the response shape depends on your application; the headers are what matter):
Verify Mutual TLS is Enforced
Confirm that inter-node traffic is actually mutually authenticated, not merely permitted. Each sidecar exposes Envoy statistics on port 15000. Query the cache node's sidecar for connections labeled with the mutual-TLS security policy:
Expected output:
The same connection_security_policy="mutual_tls" label also appears on the istio_tcp_connections_closed_total, istio_tcp_received_bytes_total, and istio_tcp_sent_bytes_total metrics. The presence of istio_tcp_connections_opened_total entries with connection_security_policy="mutual_tls" is the proof: the sidecar opened TCP connections for the cache ports and secured them with mutual TLS. A non-zero counter on the discovery and communication ports means node-to-node traffic is encrypted and authenticated.
Troubleshooting
Related
How to Encrypt Inter-Node Cluster Traffic with Linkerd on Kubernetes - The same goal with a lighter-weight mesh, focused on inter-node traffic.
Istio PeerAuthentication reference - All mTLS modes and scoping options.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

