Unfortunately we use kubectl wait --for=condition=ready pod -n capact-system --selector=... which takes into account all Pods also those in failed state which were evicted.
A better approach is to use a dedicated command which understands a given workflow, e.g.: kubectl rollout status sts/neo4j-neo4j-core --watch
Expected behavior
Ignore failed Pods which don't impact a given workload
Description
Since Kubernetes 1.20, the evicted Pods stay in cluster with failed reason. For example:
In our Capact upgrade Action we wait for cert-manager and ingress: https://github.com/capactio/hub-manifests/blob/32e1423df7afdfb2060dab99c972750159e1474c/manifests/implementation/capactio/capact/upgrade.yaml#L266-L281
Unfortunately we use
kubectl wait --for=condition=ready pod -n capact-system --selector=...
which takes into account all Pods also those in failed state which were evicted.A better approach is to use a dedicated command which understands a given workflow, e.g.:
kubectl rollout status sts/neo4j-neo4j-core --watch
Expected behavior
Ignore failed Pods which don't impact a given workload