For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

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 kubectl access. 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 -y

Confirm the control plane is running:

kubectl get pods -n istio-system

Expected output:

NAME                                    READY   STATUS    RESTARTS   AGE
istio-ingressgateway-5dcc6ff9cb-nspc9   1/1     Running   0          12m
istiod-54b5f6856c-fzkx6                 1/1     Running   0          12m

Create 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 other tcp- 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. The tcp- prefix tells Istio to treat the port as opaque TCP rather than attempting HTTP parsing.

  • holdApplicationUntilProxyStarts: true in 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):

This optional step requires the Spring Boot client deployed in the namespace. The inter-node and thin-client encryption verified in the rest of this guide does not depend on it.

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.

Istio adds a userspace hop on every connection and a small first-connection latency cost from configuration push. For long-lived inter-node traffic the per-byte overhead is modest; for very chatty short-lived calls it is more noticeable. The sidecar also adds memory and CPU per pod. This guide does not benchmark the overhead. Measure it against your own workload before rolling a mesh into production.

Troubleshooting

Cluster stalls on "Still waiting for initial partition map exchange"

The cache node started before its sidecar was ready, so the first inter-node handshake had no route. Confirm the holdApplicationUntilProxyStarts: true annotation is present on the pod template, then delete the pods so they restart with correct ordering: kubectl delete pod ignite-0 ignite-1 -n ignite.

Nodes never form a cluster after applying STRICT mTLS

Discovery or communication traffic is falling through to the PassthroughCluster as plaintext and being rejected. Verify the headless Service declares the cache ports with named, tcp- prefixed entries (tcp-discovery, tcp-communication, tcp-thinclient). Headless Services work without named ports for normal Kubernetes routing, but Istio needs them to create the outbound TCP listener.

Pods stay at 1/1 instead of 2/2

The sidecar was not injected. Confirm the namespace carries the istio-injection=enabled label with kubectl get namespace ignite --show-labels. If you labeled the namespace after deploying, restart the StatefulSet so the pods are recreated with sidecars: kubectl rollout restart statefulset/ignite -n ignite.

GridGain 8 node exits at startup with a license error

The license Secret is missing, mounted at the wrong path, or expired. Confirm the Secret exists (kubectl get secret gridgain-license -n ignite) and that the config's licenseUrl matches the mount path (/ignite/license/gridgain-license.xml). GridGain Enterprise evaluation licenses are time-limited; download a current one from gridgain.com/tryfree if yours has lapsed.

istio-ingressgateway port-forward returns connection refused

The ingress gateway is not running. The default Istio profile installs it; the minimal and demo-minimal profiles do not. Confirm with kubectl get pods -n istio-system and reinstall with istioctl install -y if the gateway pod is absent.

This page is: Copyright © 2026 MariaDB. All rights reserved.

Last updated

Was this helpful?