Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 715 Bytes

LABEL.md

File metadata and controls

25 lines (22 loc) · 715 Bytes

Migrate to new labels without downtime

  1. Delete deployment with --cascade=false
  2. Delete the corresponding replicaset with --cascade=false too
  3. Add label to orphaned pods to match the new service selector
  4. Deploy the Helm Chart
  5. Wait for the newly created pods to get ready
  6. Delete orphaned pods using old selector labels

Example

kubectl delete deploy -l release=[RELEASE],app=[NAME] --cascade=false
kubectl delete rs -l release=[RELEASE],app=[NAME] --cascade=false
kubectl label pods -l release=[RELEASE],app=[NAME] \
  app.kubernetes.io/instance=[RELEASE] \
  app.kubernetes.io/name=[NAME]
kubectl delete pods -l release=[RELEASE],app=[NAME]