问题
I just add kubectl wait --for=condition=ready pod -l app=appname --timeout=30s
in the last step of BitBucket Pipeline to report any deployment failure if the new pod somehow producing error.
I realize that the wait doesn't really consistent. Sometimes it gets timed out even if new pod from new image doesn't producing any error, pod turn to ready state.
Try to always change deployment.yaml or push newer image everytime to test this, the result is inconsistent.
BTW, I believe using kubectl rollout status
doesn't suitable, I think because it just return after the deployment done without waiting for pod ready.
Note that there is not much difference if I change timeout from 30s
to 5m
since apply or rollout restart is quite instant.
- kubectl version: 1.17
- AWS EKS: latest 1.16
来源:https://stackoverflow.com/questions/62726150/kubectl-wait-sometimes-timed-out-unexpectedly