New to Kestra?
Use blueprints to kickstart your first workflows.
A Kestra blueprint that audits Kubernetes pods for missing CPU and memory requests or limits and reports the offenders on Slack, without spamming.
list_pods (io.kestra.plugin.scripts.shell.Commands) dumps the namespace's pods as JSON with kubectl.find_unlimited (io.kestra.plugin.scripts.python.Script) inspects every container's (and init container's) resources and lists exactly which of the four are missing: cpu request, memory request, cpu limit, memory limit. Pods with nothing set are flagged BestEffort; the rest Burstable. It compares against the KV state so only newly found offenders are reported.maybe_alert (io.kestra.plugin.core.flow.If) posts the Slack report only when there is someone new to name.save_state (io.kestra.plugin.core.kv.Set) writes back the current offender list. Fixed pods drop out on their own, so a redeployed-offending pod reports again, and steady-state reruns stay quiet.Anyone running workloads on Kubernetes who suspects half their pods have no limits set. Pairs with PodSecurityWatch as a prod-readiness series: this one covers resource hygiene, that one covers security posture.
kubectl get pods never told you which ones lack limits. As a flow it audits on a schedule, keeps every run's findings where you can audit them, and only bothers you when a new offender appears. Kestra holds the cluster credentials as secrets out of the YAML.
| Secret | What it is |
|---|---|
CLIENT_CRT |
base64-encoded client certificate from your kubeconfig |
CLIENT_KEY |
base64-encoded client key from your kubeconfig |
MASTERURL |
base64-encoded Kubernetes API server URL, reachable from inside the Kestra container |
SLACK_WEBHOOK |
base64-encoded Slack Incoming Webhook URL |
In Kestra OSS, secrets come from environment variables prefixed with SECRET_ and must be base64-encoded. If the API URL uses 127.0.0.1 or localhost, replace it with host.docker.internal so the Kestra container can reach it.
SECRET_ environment variables. If minikube restarted since your last run, regenerate SECRET_MASTERURL first: the API port changes on every minikube start.kubectl run qos-bad --image=nginx, one with limits set. Run the flow: the Slack report names only qos-bad with its missing four.qos-bad and run again: quiet, it dropped out of state.| Input | Type | Default | What it does |
|---|---|---|---|
namespace |
STRING | default |
the namespace whose pods to audit |
slack_webhook |
STRING | (required) | Incoming webhook URL of the Slack channel for the report |
minikube start. Regenerate SECRET_MASTERURL and restart the Kestra container, or the kubectl step fails to connect.