Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes Deployments - Difference between status replicas and spec replicas

Tags:

kubernetes

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


1 Answers

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.

like image 119
Arghya Sadhu Avatar answered Feb 04 '26 15:02

Arghya Sadhu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!