95 / 95 · 05 Performance & Chaos Engineering · Kubernetes Scaling and Container Performance Testing← prev⊞ all☰ Read as one page
14.7CI Pipeline Integration: Full Performance and Chaos Workflow
# .github/workflows/performance-chaos.yml
name: Performance & Chaos Pipeline
on:
push:
branches: [main]
jobs:
performance-budget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run build
- name: Lighthouse CI
uses: treosh/lighthouse-ci-action@v11
with:
configPath: ./lighthouserc.json
load-test-staging:
needs: performance-budget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run k6 load tests
uses: grafana/k6-action@v0.4.0
with:
filename: tests/performance/k6-load-test.js
flags: --out json=results.json
env:
K6_TARGET_URL: ${{ secrets.STAGING_URL }}
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: k6-results
path: results.json
chaos-staging:
needs: load-test-staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Litmus
run: |
kubectl apply -f https://litmuschaos.github.io/litmus/litmus-operator-v3.0.0.yaml
- name: Run chaos experiment
run: |
kubectl apply -f chaos/pod-delete-experiment.yaml
kubectl apply -f chaos/network-delay-experiment.yaml
- name: Wait for chaos completion
run: |
kubectl wait --for=condition=complete chaosresult/checkout-chaos \
--timeout=600s
- name: Verify SLOs held during chaos
run: |
python scripts/verify_slo_during_chaos.py \
--prometheus-url ${{ secrets.PROMETHEUS_URL }} \
--slo-config slo/checkout-api.yaml \
--chaos-window 10m
This pipeline ensures that every merge to main is validated for performance (Lighthouse + k6) and resilience (Litmus chaos). The system must not only be fast -- it must stay fast when things go wrong.