Hands-on Lab

#Lab: Service Mesh with Istio

Set up service mesh with Istio.

#🎯 Objectives

  • Install Istio
  • Deploy sample app
  • Configure traffic rules

#Task 1: Install Istio

bash
1# Download
2curl -L https://istio.io/downloadIstio | sh -
3cd istio-*
4export PATH=$PWD/bin:$PATH
5
6# Install
7istioctl install --set profile=demo -y
8
9# Enable injection
10kubectl label namespace default istio-injection=enabled

#Task 2: Deploy Sample App

bash
1kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
2kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
3
4# Get URL
5kubectl get svc istio-ingressgateway -n istio-system

#Task 3: Traffic Splitting

yaml
1apiVersion: networking.istio.io/v1alpha3
2kind: VirtualService
3metadata:
4  name: reviews
5spec:
6  hosts:
7  - reviews
8  http:
9  - route:
10    - destination:
11        host: reviews
12        subset: v1
13      weight: 80
14    - destination:
15        host: reviews
16        subset: v2
17      weight: 20

#✅ Success Criteria

  • Istio installed
  • App accessible via gateway
  • Traffic split working