MATIH Platform is in active MVP development. Documentation reflects current implementation status.
18. CI/CD & Build System
Stage 18: Validation

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:

NamespacePurpose
matih-control-planeControl plane services
matih-data-planeData plane services
matih-monitoringMonitoring stack
matih-ingressIngress 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

FunctionDescription
validate_namespacesCheck all namespaces exist
validate_podsCount running vs total pods per namespace
validate_helm_releasesCheck Helm release status
validate_endpointsTest service health endpoints
generate_reportProduce deployment summary

Health Endpoint Checks

The stage probes health endpoints for critical services:

ServiceEndpointExpected
api-gateway/health200 OK
ai-service/health200 OK
config-service/actuator/health200 OK

Deployment Report

The final report includes:

SectionContent
SummaryTotal pods, running/failed counts, duration
Namespace breakdownPer-namespace pod status
Failing podsList of pods not in Running state
Helm releasesRelease name, version, status
RecommendationsSuggested actions for failures

Exit Codes

CodeMeaning
0All validations passed
1One 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 dev

Or use the standalone health check script:

./scripts/disaster-recovery/health-check.sh