Skip to main content

Introduction

Istio sidecar injection embeds an Envoy proxy alongside your application container to enable advanced traffic management, mutual TLS, and telemetry within Kubernetes. In this guide, you’ll learn how to:
  • Inject an Envoy sidecar into a pod automatically
  • Deploy a Node.js microservice in a dedicated namespace
  • Verify the injected sidecar and inspect traffic flows
Sidecar proxy is also known as a sidecar container, proxy sidecar, or Envoy sidecar—these terms are used interchangeably.

Sidecar Injection Methods

Istio offers two approaches to inject the Envoy proxy into your workloads:
We’ll use Automatic Injection for this demo, since it requires no modifications to your application manifests.

Istio Demo Architecture

The image is a diagram of an Istio demo architecture on the Azure platform, showing the interaction between Kubernetes, microservices, Envoy, Apigee, and monitoring tools. It illustrates HTTP calls, API management, and traffic management within the system.

Prerequisites

  • A Kubernetes cluster with Istio installed
  • kubectl and istioctl CLI tools available
  • Docker image siddharth67/node-service:v1 pushed to a registry

1. Create and Label the prod Namespace

First, set a shorthand for kubectl:
List your namespaces:
Create prod and confirm:

2. Deploy the Node.js Service

Deploy the Node.js microservice with a single container initially:
Expose it as a ClusterIP service on port 5000:
Verify the resources:

3. Enable Automatic Sidecar Injection

Inspect existing namespace labels:
Label prod for Istio:
The istio-system namespace is generally labeled istio-injection=disabled to prevent sidecar injection into control plane components.

4. Restart the Deployment

Trigger pod recreation so the Envoy sidecar is injected:
Confirm new pods show 2/2 READY:

5. Verify the Sidecar Injection

Inspect one of the pods in detail:
Under Containers: you should see:
  • node-service (your application)
  • istio-proxy (Envoy sidecar, e.g., docker.io/istio/proxyv2:1.9.0)
List pods again:

Next Steps

You can extend this workflow by deploying additional services—such as a Spring Boot app via Jenkins Pipeline—or by customizing traffic routing with Istio VirtualServices and DestinationRules.

Watch Video

Practice Lab