Fractal Techware

Alert runbooks /

KubeDeploymentReplicasMismatch

Deployment has fewer available replicas than desired. Free rule (MIT): the complete runbook and rule definition are below.

   
Severity warning
Pending (for:) 15m (warning)
Domain Kubernetes workloads
Requires kube-state-metrics v2.x
Rule file rules/kubernetes-workloads.rules.yml (group ftw.kubernetes-workloads.alerts)

Meaning

Desired replicas are higher than available replicas and the rollout is not making progress (updated replicas unchanged for 10 minutes).

Impact

Reduced capacity and redundancy; an outage if available replicas reach zero.

Diagnosis

Mitigation

Escalation

Route to the team that owns the namespace. Platform on-call only takes over when several namespaces are affected at once (likely a node, network or control-plane problem).

Rule definition

From rules/kubernetes-workloads.rules.yml in the free repository (MIT). Unit tests for it are in tests/.

- alert: KubeDeploymentReplicasMismatch
  expr: |-
    (kube_deployment_spec_replicas{job="kube-state-metrics", namespace=~".+"} > kube_deployment_status_replicas_available{job="kube-state-metrics", namespace=~".+"})
    and
    (changes(kube_deployment_status_replicas_updated{job="kube-state-metrics", namespace=~".+"}[10m]) == 0)
  for: 15m
  labels:
    severity: warning
  annotations:
    summary: Deployment has fewer available replicas than desired.
    description: Deployment {{ $labels.namespace }}/{{ $labels.deployment }} has had fewer available replicas than the desired {{ $value | humanize }} for longer than 15m, and no rollout is progressing.
    runbook_url: runbooks/kubernetes-workloads/KubeDeploymentReplicasMismatch.md