Tuesday, April 22, 2025

Microservices Communication Using Istio | Docker + Minikube Setup on Windows (Hands-on Tutorial)

 Introduction

In the ever-evolving world of microservices architecture, choosing the right way to enable service-to-service communication is key. Whether you're building an enterprise-scale solution or experimenting with distributed systems, understanding how microservices talk to each other is a must.

In this blog, we will explore the popular ways of microservices communication, understand the power of the Service Mesh pattern with Istio, and finally go hands-on by setting up Istio on Windows using Docker and Minikube.

🎥 Watch Full Tutorial Here:
👉 Microservices Communication Using Istio | Docker + Minikube Setup on Windows (Hands-on Tutorial)



Microservices can communicate in a few different ways:

  1. HTTP REST APIs – Most common and simple.

  2. gRPC – Efficient and high-performance.

  3. Message Queues (Kafka, RabbitMQ) – For asynchronous and decoupled communication.

However, with increasing complexity, managing this communication becomes harder — that’s where Service Mesh comes in.

What is a Service Mesh?

A Service Mesh is a design pattern that provides a dedicated infrastructure layer to manage service-to-service communication. It offers:

  • Load balancing

  • Service discovery

  • Traffic management

  • Observability

  • Security (mTLS)

  • Fault tolerance

All without changing the application code!

Sidecar Proxy & Control Plane:

The service mesh uses the Sidecar Pattern, where each service instance runs alongside a proxy container (usually Envoy).
This proxy handles all the incoming and outgoing traffic, enabling advanced traffic control and telemetry.

The Control Plane (like Istio) configures these proxies and coordinates their behavior across the mesh.

Why Istio?

Istio is one of the most powerful and widely-used service meshes. It simplifies observability, traffic management, and security for microservices. It works seamlessly with Kubernetes and supports features like:

  • Traffic shaping

  • Canary deployments

  • Circuit breakers

  • Dashboards (Kiali, Jaeger)

Step-by-Step Setup (Windows + Docker + Minikube)

Prerequisites

  1. Install Docker Desktop

  2. Set Environment Path for Docker

  3. Install Minikube (ensure virtualization support is enabled)

  4. Create a DockerHub account

Service Mesh Setup Using Istio

1. Create Microservices
  • User Service

  • Order Service

  • Payment Service

2. Build Docker Images

 docker build -t user-service ./user
docker build -t order-service ./order
docker build -t payment-service ./payment

3.  Push Images to DockerHub

docker push docker-hub-username/user-service

         docker push docker-hub-username/order-service 

        docker push docker-hub-username/payment-service

4. Start Minikube 

        minikube start

 5. Install istio 

          istioctl install --set profile=demo -y

 6. Inject Istio container as a sidecar proxy in each pod 

          kubectl label namespace default istio-injection=enabled 

 7. Run deployment yaml files to create POD replicas 

          kubectl apply -f user-deployment.yaml

          kubectl apply -f order-deployment.yaml

          kubectl apply -f payment-deployment.yaml

 8. Run Istio yaml file to enable external gateway 

          kubectl apply -f istio-gateway.yaml

 9. Run horizonal pod autoscaling yaml 

          kubectl apply -f order-hpa.yaml

          kubectl apply -f payment-hpa.yaml

          kubectl apply -f user-hpa.yaml

 10. Run Circuit breaker yaml file 

          kubectl apply -f payment-cb.yaml

 11. Get External IP that is exposed by Istio gateway

          minikube tunnel

          # In another terminal

          kubectl get svc istio-ingressgateway -n istio-system

 12. Enable Observability - Optional

          istioctl dashboard kiali

          istioctl dashboard jaeger

 13. Test the User API through postman with below url and input body data

        

All the code and Yaml files can be found in my below GITHUB link:

GITHUB Repo Link: https://github.com/jksnu/Service-Mesh.git

Setting up a service mesh using Istio may seem overwhelming at first, but once done, it significantly simplifies and strengthens your microservice communication.

If you found this blog helpful, don't forget to subscribe, like, and share the video to help others learn!

👉 Click here to watch the complete hands-on tutorial on YouTube