I am using ansible k8s module to do the pod deployment, but unfortunately, I did not find a way to use wait and wait_condition correctly.
so I tried use the until and retry to implement another waiting
each time after you run the playbook, after you use k8s module to do the deployment, until NewReplicaSetAvailable shows up in the deployment within 2 minutes(60 * 2s), otherwise the deployment failed.
In case you need to verify the deployment result, I write down here.
- name: Verify the deploy result
shell: "kubectl -n kube-system get deployment coredns --output=jsonpath='{.status.conditions[*].reason}'"
register: deploy_res
until: "'NewReplicaSetAvailable' in deploy_res.stdout"
retries: 60
delay: 2