Scenario
During a peak sales period, an e-commerce platform pushed a microservice update. The new version introduced an incorrect health check endpoint, causing Kubernetes to perceive Pods as healthy despite the service being unable to process requests. The CI/CD pipeline failed to catch this because unit and integration tests did not cover health check logic. After deployment, traffic was routed to unhealthy Pods, resulting in a spike of 5xx errors and user complaints.
Symptoms
- Monitoring alerts: HTTP 502/503 error rate surge
- User feedback: Pages fail to load, some features unavailable
- Cluster state: Pods are Running but readiness probes fail (if configured), liveness probes pass
- Logs: Application container logs show connection timeouts or request forwarding errors
Diagnosis
- Check Kubernetes events:
kubectl describe pod <pod-name>- look for probe failures or restarts. - Review Pod logs:
kubectl logs <pod-name> --previous- find application-level errors. - Verify service endpoints:
kubectl get endpoints <service-name>- confirm Pods are in the endpoint list. - Test health check manually: e.g.,
curl http://localhost:8080/healthzfrom within the Pod. - Inspect CI/CD pipeline: Review recent build logs to see if tests were skipped or failed.
Commands
# Get Pod status
kubectl get pods -n production -l app=myservice
# Describe Pod for events
kubectl describe pod myservice-xxx -n production
# View logs
kubectl logs -l app=myservice --tail=100 -n production
# Verify service endpoints
kubectl get endpoints myservice -n production
# Test health check (enter Pod)
kubectl exec -it myservice-xxx -n production -- curl http://localhost:8080/healthz
# Check CI/CD pipeline (example with Jenkins)
curl -u user:token https://jenkins.example.com/job/myservice-release/lastBuild/consoleText
Risk Controls
- Immediate rollback: Use fast rollback mechanism (see next section).
- Traffic restriction: Use Kubernetes NetworkPolicy or Ingress rules to block the faulty version.
- Halt releases: Stop further deployments until root cause is determined.
- Enable circuit breaker: If using service mesh, configure circuit breaking.
- Notify team: Send incident alert via PagerDuty/Slack.
Rollback
# Method 1: kubectl rollout undo
kubectl rollout undo deployment/myservice -n production
# Method 2: Revert to known stable version
kubectl set image deployment/myservice myservice=myregistry.azurecr.io/myservice:v1.2.3-stable -n production
# Method 3: Helm rollback
helm rollback myservice 1 -n production
After rollback, monitor error rate to ensure it drops.
Verification
- Monitor metrics: Confirm error rate returns to zero, P95 latency normalizes.
- Check Pod status: All Pods should be Ready.
- Functional tests: Run smoke tests to verify critical user flows.
- Regression tests: Execute automated integration test suite.
- Pipeline review: Add health check validation step to CI/CD.
When to Submit an OpsGlobal Ticket
- If issues persist after rollback, underlying infrastructure may be involved.
- Need to audit CI/CD permissions or configuration changes.
- Require SRE expertise to design robust guardrails (canary releases, blue-green deployments).
- Need root cause analysis and post-incident report.
When submitting, include: timestamp, affected services, error log snippets, and troubleshooting steps already performed.
Use cases
Useful for teams handling CI/CD issues and needing a clear troubleshooting and delivery workflow.
Problem background
A real-world production incident illustrates the critical need for guardrails in CI/CD pipelines. Covers diagnosis, fix commands, risk controls, rollback, verification, and when to escalate to OpsGlobal.
Troubleshooting steps
Confirm impact and recent changes, collect logs, configuration and metrics, then apply fixes from low to high risk.
Command examples
Replace sample resource names with real values and store passwords, tokens and keys in environment variables.
Risks
Before production changes, confirm backups, access boundaries, change windows and rollback paths.
Rollback plan
Keep original configuration and release versions; roll back config, images or database changes if metrics degrade.
Deliverables
Root-cause notes, key commands, remediation steps, verification results and follow-up recommendations.
Need help with a similar technical issue?
If your servers, Kubernetes, Docker, CI/CD, databases or monitoring systems have similar issues, submit logs and config files for remote diagnosis.