Kubernetes Smoke & Health-Check Automation
Shell automation for apps on Minikube
A small, real set of operational scripts. The application is deployed to Minikube as frontend and backend NodePort services; the scripts then confirm that the backend returns the expected response, that the frontend answers over HTTP and that its pods are running, and that the host has CPU, memory and disk headroom.
Related articles
The problem
After a deployment, someone has to confirm the application actually works. Doing that by hand is slow and inconsistent, and resource problems on the host are noticed only after users complain.
Smoke & health-check automation
Scope & evidence
What is implemented publicly, documented, done in professional work, or still planned.
- Minikube deployment of frontend and backend servicesPublic code
- Backend smoke test: HTTP response body assertionPublic code
- Frontend HTTP status check and pod uptime via kubectlPublic code
- Host monitor: memory, disk, top processes, CPU loadPublic code
- CPU above 80% writes a timestamped logPublic code
- Run as a post-deploy stage in CIPlanned
- Alerting to chat or emailPlanned
Technology stack
- Shell (Bash)
- curl
- kubectl
- Minikube
- Kubernetes NodePort services
- cron
- Linux (free, df, ps, top)
What makes it hard
01
Clear pass/fail
Assert on the exact expected response and on HTTP status codes so a script result is unambiguous in CI logs.
02
Cluster and host view
Combine application checks (HTTP, pods) with host metrics so a failure can be traced to the app or the machine.
Implementation approach
- 1Deploy frontend and backend to Minikube and expose them as NodePort services.
- 2apptest.sh calls the backend and compares the body with the expected message.
- 3health_check.sh sends an HTTP HEAD request to the frontend, maps 200/404/other to a result and reads pod uptime with kubectl.
- 4monitor.sh prints memory, disk, top memory processes and CPU load, logging when CPU exceeds 80%; scheduled with cron.
Security considerations
- Scripts are read-only checks; they do not change cluster state.
- Run under a non-root user with kubeconfig scoped to the target namespace.
Deployment approach
- Scheduled with cron on the host.
- Planned: called as the post-deploy verification step of the CI/CD delivery plan.