<p>Need to know the difference between kube_deployment_status_replicas and kube_deployment_spec_replicas metric in kubernetes deployments</p>

<p>In a nutshell the difference is actual state vs desired state.</p>

<p><code>kube_deployment_status_replicas</code>  means the number of replicas per deployment. This is the value of <code>Status.Replicas</code>.</p>

<p>From the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#deploymentstatus-v1-apps" rel="nofollow noreferrer">API docs</a>. </p>

<blockquote>
  <p>Total number of non-terminated pods targeted by this deployment (their
  labels match the selector).</p>
</blockquote>

<p><code>kube_deployment_spec_replicas</code> means number of desired pods for a deployment. This is the value of <code>Spec.Replicas</code></p>

<p>From the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#deploymentspec-v1-apps" rel="nofollow noreferrer">API docs</a>. </p>

<blockquote>
  <p>Number of desired pods. This is a pointer to distinguish between
  explicit zero and not specified. Defaults to 1.</p>
</blockquote>
