Container health checks via liveness and readiness probes are essential for Kubernetes workloads to ensure resilience and prevent production issues.
A custom Kubernetes Admission Controller is discussed in this post to enforce the presence of liveness and readiness probes on all pods.
Enforcing probes ensures better resilience, standardization of practices, and automation of policy enforcement at the cluster level.
The Admission Controller checks for required probes (liveness, readiness) on every container and rejects pod creations lacking any configured probe.
A demo showcases how pods with missing probes are blocked in default namespaces but allowed in excluded namespaces like kube-system.
Pre-requisites for installation include a Kubernetes cluster with cert-manager installed and applying the provided manifests for the admission controller.
The implementation logic involves checking and validating probes for containers in incoming pod create/update requests, responding with approval or rejection accordingly.
Documentation references on Kubernetes Admission Controllers and extensible admission controllers are provided for further understanding.