问题
I am trying to run a process in only ONE docker pod (and not the other n pods),
can I know (from inside a pod/instance)
- am I the first pod?
- how many pods are running?
thanks.
回答1:
Don't do this. Put that thing in its own deployment (or statefulset more likely) that is unrelated to the others.
来源:https://stackoverflow.com/questions/61090273/run-a-task-in-only-one-pod-of-multiple-pods