79260655

Date: 2024-12-07 13:08:18
Score: 0.5
Natty:
Report link

In my case, I needed to recreate a group of many pods, controlled by different deployments/statefulsets with restartPolicy: Always

  1. Assign label for pods. On deployment/statefulset/daemonset manifest add label at the .spec.template.metadata.labels.
  2. Apply/recreate resources (in any way convenient for you). Then check if the changes have been applied:
# kubectl get po -l "app_group=my_grp"
  1. Recreate pods by deleting them (according to their controllers restart policy .spec.template.spec.restartPolicy):
# kubectl delete po -l "app_group=my_grp"

Make sure that the old pods are terminating and new ones should be created instead:

# kubectl get po -w

But there's probably a better way.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: dj_donut