Stage 18: Validation
Stage 18 is the final pipeline stage. It validates the entire deployment by checking namespace existence, pod health, service endpoints, Helm release status, and generating a comprehensive deployment report.
Source file: scripts/stages/18-validate.sh
Validation Checks
Namespace Validation
Verifies all required namespaces exist:
| Namespace | Purpose |
|---|---|
matih-control-plane | Control plane services |
matih-data-plane | Data plane services |
matih-monitoring | Monitoring stack |
matih-ingress | Ingress controller |
Pod Health
For each namespace, the stage counts running vs total pods:
ns_total=$(kubectl get pods -n "$ns" --no-headers | wc -l)
ns_running=$(kubectl get pods -n "$ns" --no-headers | grep -c "Running")A namespace is flagged if any pods are not in Running state.
Validation Functions
| Function | Description |
|---|---|
validate_namespaces | Check all namespaces exist |
validate_pods | Count running vs total pods per namespace |
validate_helm_releases | Check Helm release status |
validate_endpoints | Test service health endpoints |
generate_report | Produce deployment summary |
Health Endpoint Checks
The stage probes health endpoints for critical services:
| Service | Endpoint | Expected |
|---|---|---|
| api-gateway | /health | 200 OK |
| ai-service | /health | 200 OK |
| config-service | /actuator/health | 200 OK |
Deployment Report
The final report includes:
| Section | Content |
|---|---|
| Summary | Total pods, running/failed counts, duration |
| Namespace breakdown | Per-namespace pod status |
| Failing pods | List of pods not in Running state |
| Helm releases | Release name, version, status |
| Recommendations | Suggested actions for failures |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | All validations passed |
| 1 | One or more critical validations failed |
Dependencies
- Requires:
08-control-plane-services,16-data-plane-services - Required by: None (terminal stage)
Running Validation Independently
./scripts/cd-new.sh validate devOr use the standalone health check script:
./scripts/disaster-recovery/health-check.sh