Kubernetes Deployments - Difference between status replicas and spec replicas

2/21/2020

Need to know the difference between kube_deployment_status_replicas and kube_deployment_spec_replicas metric in kubernetes deployments

-- M.Shobana
kubernetes

1 Answer

2/21/2020

In a nutshell the difference is actual state vs desired state.

kube_deployment_status_replicas means the number of replicas per deployment. This is the value of Status.Replicas.

From the API docs.

Total number of non-terminated pods targeted by this deployment (their labels match the selector).

kube_deployment_spec_replicas means number of desired pods for a deployment. This is the value of Spec.Replicas

From the API docs.

Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.

-- Arghya Sadhu
Source: StackOverflow