- Declarative scaling (replicas).
- Self-healing (automatically recreates failed Pods).
- Rolling updates (upgrade without downtime or manual Pod replacement).
- No simple scaling (e.g., to increase from 1 to 5 instances).
- No controller to watch and recreate failed Pods.
- No built-in rolling upgrade mechanism — manual Pod replacement can cause downtime.
Prerequisite: This guide assumes you previously deployed the voting and result apps as Pods and exposed them with NodePort Services so they could be reached externally.
kubectl cleanup
spec into spec.template of the Deployment, and add replicas and a selector.matchLabels that matches template.metadata.labels.
Make sure
spec.selector.matchLabels in the Deployment exactly matches spec.template.metadata.labels. If they differ, the Deployment will reject the manifest.selector matches the labels used by the Deployment templates. Example NodePort snippet used to expose the vote app (unchanged from the pod-based configuration):
apiVersion: apps/v1, includes replicas, selector.matchLabels, and template (the embedded Pod spec). Place these manifests in your deployments directory and apply them with kubectl apply -f ..
vote-deployment.yaml