test: use node readiness as an indicator to run kubetest
it seems the `get service` command succeeded before the cluster was actually ready to take workloads,
which occasionally means kubetest runs before the node is ready for it to, causing a flake
daemon_reload: yes
- name: wait for the cluster to be running
- command: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/_output/bin/kubectl get service kubernetes --namespace default"
+ # ref: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
+ shell: "{{ ansible_env.GOPATH }}/src/k8s.io/kubernetes/_output/bin/kubectl get nodes -o jsonpath='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' 2>&1 | grep 'Ready=True'"
register: kube_poll
until: kube_poll.rc == 0
retries: 100
