Skip to content

Commit

Permalink
Simplify waiting until kubernetes is ready
Browse files Browse the repository at this point in the history
Wait on the /readyz health endpoint instead of kubectl version, and
remove the wait for coredns.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Sep 21, 2024
1 parent 4f72909 commit 1486efc
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/drenv/providers/lima/k8s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,15 @@ probes:
hint: |
The k8s kubeconfig file has not yet been created.
- description: "kubernetes cluster to be running"
- description: "kubernetes cluster to be ready"
script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 300s bash -c "until kubectl version >/dev/null 2>&1; do sleep 3; done"; then
echo >&2 "kubernetes cluster is not up and running yet"
if ! timeout 600s bash -c "until kubectl get --raw /readyz 2>/dev/null; do sleep 3; done"; then
echo >&2 "kubernetes cluster is not ready yet"
exit 1
fi
- description: "coredns deployment to be running"
script: |
#!/bin/bash
set -eux -o pipefail
kubectl wait -n kube-system --timeout=180s --for=condition=available deploy coredns
copyToHost:
- guest: "/etc/kubernetes/admin.conf"
host: "{{.Dir}}/copied-from-guest/kubeconfig.yaml"
Expand Down

0 comments on commit 1486efc

Please sign in to comment.