CICD-347 · Pod termination testing
Encyclopedia · Distributed systems and reliability testing · All snippets
Previous · CICD-346 · Next · CICD-348
1. Where it fits
- Placement isolated lab terminal.
- Prerequisites disposable integration environment, synthetic traffic and controlled test faults.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
pod=$(kubectl -n chaos-lab get pod -l app=web -o jsonpath='{.items[0].metadata.name}')
kubectl -n chaos-lab delete pod "$pod" --wait=false
kubectl -n chaos-lab rollout status deployment/web --timeout=120s3. How it works
The lab script reads one Pod identity and requests its deletion. A replica controller can replace it while a separate continuous probe measures any availability gap.
4. Verify the result
Record readiness and availability through replica replacement. An existing rollout status alone does not measure transient request loss.
Watch for. Confine the test and all synthetic traffic to an authorized, disposable lab. Check cleanup even after a failing assertion.
Validation syntax-validated (Bash parse). Status definitions.