Skip to main content
In this lesson you will configure authentication on an Istio Service Mesh by:
  • Deploying a Hello World application.
  • Enforcing peer authentication (mTLS) globally.
  • Observing how non-Istio workloads are affected when mTLS is required.
  • Enabling sidecar injection to allow pods to communicate using mTLS.
Relevant concepts: Istio sidecar injection, Envoy proxy, PeerAuthentication, mTLS, namespace labeling. Links and references

Verify namespace sidecar injection

Confirm the default namespace has Istio sidecar injection enabled:

Deploy the Hello World application

Apply your Hello World manifests (Deployment + Service). Verify the pods in default namespace are running and have two containers (app + Envoy sidecar):
Confirm the Hello World Service and its port (5000):

Create a test namespace and run a plain (non-Istio) pod

Create a new namespace test and run an NGINX pod without sidecar injection:
From the test pod (which is NOT Istio-injected), curl the Hello World service in default. Plaintext traffic is permitted by default, so this should succeed:

Enforce mTLS cluster-wide using PeerAuthentication

By default, Istio does not enforce mTLS mesh-wide. To require mTLS for all cluster traffic, create a global PeerAuthentication resource in the istio-system namespace with STRICT mode. Create peer_auth_global.yaml:
Apply the resource and confirm it exists:

Observe effect: non-injected pod cannot communicate

After enabling strict mTLS globally, the non-injected test pod (no Envoy sidecar) cannot perform TLS-mutual communication and will be rejected. Retry the curl from the test pod:
Reason: the global PeerAuthentication requires mTLS, but the test pod does not have an Envoy sidecar and cannot speak mTLS.

Enable sidecar injection for the test namespace and recreate the pod

Use istioctl analyze to get a recommendation (it will point out that test is not injection-enabled):
Label the namespace to enable automatic sidecar injection, then delete and recreate the test pod so it receives an Envoy proxy:
Now the test pod has two containers (app + Envoy sidecar) and can perform mTLS to the helloworld service.

Verify successful mTLS communication

Retry the curl; Envoy now handles mTLS and returns a successful HTTP response:
This confirms the pod with an Envoy sidecar can communicate successfully under a global STRICT mTLS policy.

Quick reference: common commands and resources

Note: when you put JSON or objects in tables, wrap them in backticks, e.g. [{ "object": "person" }].
Enabling istio-injection=enabled on a namespace does not retroactively inject sidecars into existing pods — delete and recreate pods to pick up the Envoy sidecar. Also ensure the PeerAuthentication API version (security.istio.io/v1beta1) matches your Istio control-plane version; this is commonly used in recent Istio releases.

Watch Video

Practice Lab