Skip to content

Commit 4a41bd1

Browse files
johnmathewsclaude
andcommitted
Add KEDA scaling, Grafana dashboard, Chaos Mesh, Locust, and deploy workflow
Complete stages 5-9 of the implementation plan: - KEDA ScaledObjects for all 3 worker deployments (queue-depth autoscaling) - Grafana dashboard JSON (7 panels, 5s refresh for live demo) - Chaos Mesh experiments (pod-kill, network-delay, cpu-stress) - Locust load test with 4 weighted task types - GitHub Actions deploy workflow (ACR build + AKS deploy) - Added workflow_call trigger to ci.yml for reuse by deploy workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f05eccd commit 4a41bd1

10 files changed

Lines changed: 917 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
workflow_call:
89

910
jobs:
1011
lint:

.github/workflows/deploy.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Deploy to AKS
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "src/**"
8+
- "k8s/**"
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: deploy-aks
13+
cancel-in-progress: false
14+
15+
jobs:
16+
ci:
17+
uses: ./.github/workflows/ci.yml
18+
19+
build-and-deploy:
20+
needs: ci
21+
runs-on: ubuntu-latest
22+
environment: production
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Log in to Azure
28+
uses: azure/login@v2
29+
with:
30+
creds: ${{ secrets.AZURE_CREDENTIALS }}
31+
32+
- name: Build and push gateway image to ACR
33+
run: |
34+
az acr build \
35+
-r acrdocumentstream \
36+
-t gateway:${{ github.sha }} \
37+
-t gateway:latest \
38+
-f src/gateway/Dockerfile .
39+
40+
- name: Build and push worker image to ACR
41+
run: |
42+
az acr build \
43+
-r acrdocumentstream \
44+
-t worker:${{ github.sha }} \
45+
-t worker:latest \
46+
-f src/worker/Dockerfile .
47+
48+
- name: Set AKS context
49+
run: |
50+
az aks get-credentials \
51+
-n documentstream-aks \
52+
-g documentstream-rg \
53+
--overwrite-existing
54+
55+
- name: Apply K8s manifests
56+
run: kubectl apply -k k8s/base/
57+
58+
- name: Update deployment image tags
59+
run: |
60+
kubectl set image deployment/gateway \
61+
gateway=acrdocumentstream.azurecr.io/gateway:${{ github.sha }} \
62+
-n documentstream
63+
64+
kubectl set image deployment/extract-worker \
65+
extract-worker=acrdocumentstream.azurecr.io/worker:${{ github.sha }} \
66+
-n documentstream
67+
68+
kubectl set image deployment/classify-worker \
69+
classify-worker=acrdocumentstream.azurecr.io/worker:${{ github.sha }} \
70+
-n documentstream
71+
72+
kubectl set image deployment/store-worker \
73+
store-worker=acrdocumentstream.azurecr.io/worker:${{ github.sha }} \
74+
-n documentstream
75+
76+
- name: Wait for rollouts
77+
run: |
78+
kubectl rollout status deployment/gateway -n documentstream --timeout=120s
79+
kubectl rollout status deployment/extract-worker -n documentstream --timeout=120s
80+
kubectl rollout status deployment/classify-worker -n documentstream --timeout=120s
81+
kubectl rollout status deployment/store-worker -n documentstream --timeout=120s

0 commit comments

Comments
 (0)