⚡ Onwuachi Control Plane

Platform Validation Script

Overview

platform-validation.sh is a reusable post-deployment validation script developed for the Platform Foundation project.

Rather than manually executing numerous commands after infrastructure changes, this script performs a consolidated health check of the operating system, Docker runtime, container resource limits, and overall platform configuration.

It serves as a repeatable validation step following deployments, upgrades, and maintenance windows.


Why It Matters

Infrastructure changes rarely fail immediately.

Most production issues occur because something appears healthy while a lower-level dependency is misconfigured.

Examples include:

Instead of remembering dozens of validation commands, platform-validation.sh provides a single source of truth for verifying platform health.


Where It Fits

Infrastructure Change
Platform Deployment
platform-validation.sh
        ├── Docker Validation
        ├── Container Validation
        ├── File Descriptor Validation
        ├── Host Validation
        ├── Kernel Validation
        └── Operating System Validation

Current Validation Checks

The script currently collects the following information:

Container Health

Platform Health

Software Versions


Script Source

#!/usr/bin/env bash

echo "======================================="
echo "Docker File Descriptor Health Check"
echo "Host: $(hostname)"
echo "Time: $(date)"
echo "======================================="

printf "\n%-35s %-8s %-8s %-8s\n" \
"Container" "PID" "FDs" "Limit"

TOTAL=0

for c in $(docker ps --format '{{.Names}}'); do

    PID=$(docker inspect --format '{{.State.Pid}}' "$c" 2>/dev/null)

    [ -z "$PID" ] && continue
    [ "$PID" = "0" ] && continue

    FD_COUNT=$(ls /proc/$PID/fd 2>/dev/null | wc -l)
    FD_LIMIT=$(awk '/Max open files/ {print $4}' /proc/$PID/limits)

    TOTAL=$((TOTAL+FD_COUNT))

    printf "%-35s %-8s %-8s %-8s\n" \
    "$c" "$PID" "$FD_COUNT" "$FD_LIMIT"

done

echo
echo "---------------------------------------"
echo "Total Stack FDs : $TOTAL"

echo
echo "Host file-max:"
cat /proc/sys/fs/file-nr

echo
echo "Docker daemon ulimits:"
cat /etc/docker/daemon.json

echo
docker version --format 'Docker {{.Server.Version}}'
containerd --version
lsb_release -a
hostnamectl
uname -r

Example Output

=======================================
Docker File Descriptor Health Check

Host: secure23
Time: Fri Jul 17 10:34:19 CDT 2026

Container                           PID      FDs     Limit
----------------------------------------------------------
haproxy                             1254      52     524288
prometheus                          1321      87     524288
grafana                             1498      74     524288
node-exporter                       1612      18     524288

---------------------------------------
Total Stack FDs : 231

Host file-max:
2848    0    9223372036854775807

Docker daemon ulimits:
{
  "default-ulimits": {
    "nofile": {
      "Name": "nofile",
      "Soft": 524288,
      "Hard": 524288
    }
  }
}

Docker 29.0.1
containerd 2.2.x
Ubuntu 24.04 LTS
Kernel 6.8.x

Real-World Background

This script originated during production Ubuntu upgrade testing.

During validation it became apparent that checking whether Docker was running was insufficient.

A Docker Engine upgrade changed the default container file descriptor limits, causing new containers to inherit Linux’s default limit of 1024 instead of the expected 524288.

The containers appeared healthy but would eventually fail under higher connection loads.

The script was expanded to verify container limits directly rather than relying solely on Docker service status.


Usage

Execute from the platform repository:

./platform-validation.sh

or

bash platform-validation.sh

Typical Use Cases

Run after:


Engineering Analogy

Think of platform-validation.sh as the infrastructure equivalent of an aircraft pre-flight inspection.

A pilot does not simply verify that the engines start.

Instead, they confirm fuel systems, hydraulics, navigation, instrumentation, weather, communications, and flight controls before takeoff.

Likewise, this script verifies multiple layers of platform health before declaring a deployment successful.


Best Practices


Common Mistakes


Future Improvements

Planned additions include:


Pro Tip

Treat platform-validation.sh as the central health validation framework for Platform Foundation.

Every new subsystem—Docker, Terraform, HAProxy, Prometheus, AWS services, certificates, backups, or monitoring—should contribute additional validation checks to this script instead of creating standalone utilities.

The goal is a single command capable of validating the entire platform after any infrastructure change.


Key Takeaways


Related Articles


References

System Context

← Back to Kb