Kubernetes Deployment Scaling
Kubernetes Deployment Scaling
When the monitor alerts, the Flow reads the deployment's current replica count and HPA status, then applies a capped scale-up: if an autoscaler manages the deployment it raises its minReplicas floor (a direct replica patch would be overridden), otherwise it patches spec.replicas directly. After a rollout grace period it verifies pod readiness and posts the outcome to Slack with before/after metrics — or a warning when pods aren't ready. Recovery notifications never trigger scaling, and failures are reported to Slack.
After importing, configure the Datadog and Kubernetes installations, point the Kubernetes blocks at your deployment, set the monitor ID, and create a SLACK_CHANNEL_ID secret. Add the @webhook-spacelift-flows-... handle created by the Datadog installation to your monitor's message so alerts reach the Flow. The scaling step and replica cap are constants in the Plan Scaling expression.
KubernetesGet Resource
KubernetesList Resources
KubernetesPatch Resource
KubernetesPatch Resource
KubernetesGet Resource