Kubectl wait for one pod of a statefulset to be READY?

Viewed 5885

To wait for a certain pod to be completed the command is

kubectl wait --for=condition=Ready pod/pod-name

Similarly I want to wait for any one pod in the statefulset to be ready. I tried the command below which did not work,

kubectl wait --for=condition=Ready statefulset/statefulset-name

What should the command options look like?

2 Answers

I used following and it works for me

kubectl wait -l statefulset.kubernetes.io/pod-name=activemq-0 --for=condition=ready pod --timeout=-1s
Related