Skip to content

Latest commit

 

History

History
116 lines (84 loc) · 2.96 KB

File metadata and controls

116 lines (84 loc) · 2.96 KB

Task 12: Istio Canary Upgrade with Revisions

Step 1: Switch to Correct Context

kubectl config use-context cluster3-admin@cluster3

Step 2: Check Current Istio Version

# Check current Istio version
istioctl version

# Expected output:
# client version: 1.26.3
# control plane version: 1.26.3 (current version - no revision)

Step 3: Install New Control Plane with Revision

# Install Istio with revision 1-26-3
istioctl install --set profile=demo --revision=1-26-3 -y

Step 4: Verify New Control Plane

# Check istiod deployments (should see both default and revisioned)
kubectl get deployment -n istio-system

# Expected output:
# NAME              READY   UP-TO-DATE   AVAILABLE   AGE
# istiod            1/1     1            1           30d    (default - no revision)
# istiod-1-26-3     1/1     1            1           1m     (with revision 1-26-3)

# Check services
kubectl get svc -n istio-system | grep istiod
# Should show: istiod and istiod-1-26-3

Step 5: Tag the New Revision

# Tag the revision as 'latest'
istioctl tag set latest --revision 1-26-3

# This creates a webhook that maps 'latest' tag to revision '1-26-3'
# Verify tag
istioctl tag list

Step 6: Migrate amber Namespace

# Update namespace to use the 'latest' tag
kubectl label namespace amber istio.io/rev=latest --overwrite

# Remove old injection label if present
kubectl label namespace amber istio-injection-

# Verify label
kubectl get namespace amber --show-labels
# Should show: istio.io/rev=latest

Step 7: Restart Workloads in amber Namespace

# Restart deployment to inject new sidecar version
kubectl rollout restart deployment sleep-amber -n amber

Step 8: Verify Migration

# Check proxy status
istioctl proxy-status

# Verify pods are using the new revision
kubectl get pods -n amber -l app=sleep-amber -o jsonpath='{.items[0].metadata.annotations.istio\.io/rev}'
# Should show: 1-26-3

# Check which control plane the pod is connected to
POD_NAME=$(kubectl get pod -n amber -l app=sleep-amber -o jsonpath='{.items[0].metadata.name}')
kubectl exec -n amber $POD_NAME -c istio-proxy -- pilot-agent request GET config_dump | grep istiod-1-26-3
# Should show connection to istiod-1-26-3

# Verify pod has 2 containers (app + istio-proxy)
kubectl get pods -n amber -l app=sleep-amber
# Should show: 2/2 Running

Verification Commands

# Check both control planes running
kubectl get deployment -n istio-system | grep istiod
# Should show: istiod (default) and istiod-1-26-3 (with revision)

# Verify revision exists
istioctl version --revision 1-26-3

# Check tag mapping
kubectl get mutatingwebhookconfigurations | grep istio

# Verify namespace label
kubectl get namespace amber -o jsonpath='{.metadata.labels.istio\.io/rev}'
# Should output: latest

# Check pod annotations
kubectl get pod sleep-amber -n amber -o yaml | grep "sidecar.istio.io/status" | head -1
# Should show revision annotation