-
Notifications
You must be signed in to change notification settings - Fork 21
Improve k8s_setup.sh debugging #161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| out=$(kubectl get nodes -o jsonpath="$JSONPATH") | ||
| echo "${out}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably would have made it clear why this failure occurred (kubectl was XML instead of a binary which caused a 10m timeout failure)
| JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}' | ||
| out='' | ||
| until [[ "${out}" =~ 'Ready=True' ]]; do | ||
| sleep 1 | ||
| out=$(kubectl get nodes -o jsonpath="$JSONPATH") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw here a better alternative for this logic?
echo "Waiting for cluster to be ready"
kubectl wait --for=condition=Ready nodes --all --timeout=60s >/dev/null 2>&1AFAIK that is performing the same query? There script likewise calls kind create cluster just prior to this, but inlines a custom config:
echo "Creating Kind Cluster"
cat <<EOF | kind create cluster --config=- || exit 1
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v${VERSION}
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOFThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that is better, thanks for the tip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I already raised a PR for that change alone given the age of this PR 😅 (which doesn't inspire much hope for the PRs I raised for the CI to get merged)
* Don't hide kubectl stderr. * Print output of kubectl node status. * Use `/usr/bin/env` to access bash for improved platform comaptibility. Signed-off-by: SuperQ <superq@gmail.com>
383724b to
610a7ce
Compare
/usr/bin/envto access bash for improved platform comaptibility.