run a task in only ONE pod (of multiple pods)

混江龙づ霸主 提交于 2021-01-29 12:33:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!