This repository contains a hands-on Kubernetes demo designed to reinforce an accelerated learning presentation on Kubernetes and Istio.
The goal is not to teach YAML in isolation, but to help engineers and architects build a correct mental model of how Kubernetes behaves before introducing service mesh complexity.
This demo was originally inspired by real-world enablement work with enterprise customers, where understanding why Kubernetes behaves the way it does is more valuable than memorizing resources.
Phase 1 intentionally excludes Istio.
The objective is to demonstrate what Kubernetes alone provides:
- Declarative application deployment
- Pod scheduling and lifecycle management
- Service discovery via DNS
- Load balancing across replicas
- Namespace isolation
- Desired-state reconciliation
Once these fundamentals are internalized, Istio becomes additive rather than confusing.
Browser
|
v
Frontend Service (NodePort)
|
v
Backend Service (ClusterIP)
|
v
Backend Pods (v1 replicas)
k8s-istio-demo/
├── README.md
├── prerequisites.md
├── scripts/
│ └── 01-start-minikube.ps1
├── k8s/
│ ├── namespace.yaml
│ ├── backend-v1.yaml
│ ├── frontend.yaml
│ └── service.yaml
├── app/
│ ├── backend/
│ └── frontend/
├── diagrams/
├── terraform/
└── ansible/
.\scripts\01-start-minikube.ps1kubectl apply -f k8s/namespace.yaml
kubectl apply -f k8s/backend-v1.yaml
kubectl apply -f k8s/frontend.yaml
kubectl apply -f k8s/service.yamlminikube service frontend -n demoExpected output:
Frontend received -> Backend v1 responding from backend-v1-xxxxx
Phase 2 introduces Istio:
- Sidecar injection
- Canary routing
- Traffic shaping
- Security and policy enforcement
This repository demonstrates how Istio adds traffic management and progressive delivery on top of Kubernetes using a simple frontend/backend application.
Phase 2 focuses on:
- Istio installation
- Sidecar injection
- Gateway-based ingress
- Canary traffic splitting between backend v1 and v2
Phase 2 is fully independent. You do not need to run Phase 1 first.
Ensure the following are installed and available in your PATH:
- Docker Desktop (running, Linux containers)
- Minikube
- kubectl
- istioctl
Verify:
docker version
minikube version
kubectl version --client
istioctl versionYou will use two PowerShell windows:
Used to:
- Start Minikube
- Install Istio
- Deploy workloads
- Apply traffic policies
Used to:
- Generate HTTP requests
- Observe traffic distribution changes in real time
This separation avoids interrupting Minikube tunnels and keeps testing clean.
From the repository root:
.\scripts\phase2-bootstrap.ps1This script automatically:
- Starts Minikube
- Deploys the baseline app (frontend + backend v1)
- Installs Istio (demo profile)
- Enables sidecar injection
- Redeploys workloads with Envoy
- Deploys backend v2
- Applies Istio Gateway and VirtualServices
- Configures a 90/10 canary split (v1/v2)
Wait until the script completes successfully.
Still in Window #1, run:
minikube service istio-ingressgateway -n istio-systemImportant notes:
- Keep this window open (required for Minikube tunnel on Windows)
- Multiple localhost URLs may appear – any
http://127.0.0.1:<port>is valid - This is the only correct entry point for Phase 2
Open a new PowerShell window.
Run:
$url = (minikube service istio-ingressgateway -n istio-system --url | Select-Object -First 1)
$urlThis stores the Istio ingress URL for testing.
In Window #2:
1..20 | % {
(Invoke-WebRequest -UseBasicParsing $url).Content.Trim()
}Expected:
- Mostly
Backend v1 responding - Occasional
Backend v2 responding
This confirms Istio is actively managing traffic.
Window #1:
kubectl apply -f istio/virtual-service-50-50.yamlWindow #2:
1..20 | % {
(Invoke-WebRequest -UseBasicParsing $url).Content.Trim()
}Expected:
- Roughly equal v1 and v2 responses
Window #1:
kubectl apply -f istio/virtual-service-100-0.yamlWindow #2:
1..10 | % {
(Invoke-WebRequest -UseBasicParsing $url).Content.Trim()
}Expected:
- Only
Backend v2 responding - No redeploys
- No restarts
kubectl get pods -n demo
kubectl get gateway,virtualservice,destinationrule -n demoExpected:
- Pods show
READY 2/2(app + Envoy) - Istio resources present and configured
- Kubernetes handles deployment and service discovery
- Istio adds declarative traffic control
- Canary releases are:
- Immediate
- Reversible
- Code-free
- Traffic behavior changes without touching workloads
This mirrors how enterprises safely roll out changes in production.
minikube delete --all --purge- Phase 3: mTLS and AuthorizationPolicy
- Observability with Kiali and Prometheus
- Failure injection and retries
- Terraform and Ansible automation
Author note:
This demo was designed as an accelerated learning lab for engineers and architects to quickly internalize how Kubernetes and Istio work together in real-world environments.
This project is licensed under the MIT License - see the LICENSE file for details.
Author: Steven Lopez