Skip to content

Print debug info if cluster up times out #1396

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

Merged
merged 6 commits into from
Sep 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions manager/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,31 @@ function validate_cortex() {

operator_load_balancer="waiting"
api_load_balancer="waiting"
operator_endpoint_reachable="waiting"
operator_endpoint_reachable="false"
operator_pod_ready_cycles=0
operator_endpoint=""
operator_pod_name=""
operator_pod_is_ready=""

while true; do
# 30 minute timeout
now="$(date +%s)"
if [ "$now" -ge "$(($validation_start_time+1800))" ]; then
echo -e "\n\ntimeout has occurred when validating your cortex cluster"
echo -e "\ndebugging info:"
echo "operator pod name: $operator_pod_name"
echo "operator pod is ready: $operator_pod_is_ready"
echo "operator pod ready cycles: $operator_pod_ready_cycles"
echo "api load balancer status: $api_load_balancer"
echo "operator load balancer status: $operator_load_balancer"
echo "operator endpoint: $operator_endpoint"
if [ "$CORTEX_OPERATOR_LOAD_BALANCER_SCHEME" == "internet-facing" ]; then
echo "operator endpoint reachable: $operator_endpoint_reachable"
fi
if [ "$operator_endpoint" != "" ]; then
echo "operator curl response (404 is expected):"
curl --max-time 3 $operator_endpoint
fi
exit 1
fi

Expand All @@ -385,8 +401,8 @@ function validate_cortex() {
if [ "$operator_pod_name" == "" ]; then
operator_pod_ready_cycles=0
else
is_ready=$(kubectl -n=default get "$operator_pod_name" -o jsonpath='{.status.containerStatuses[0].ready}')
if [ "$is_ready" == "true" ]; then
operator_pod_is_ready=$(kubectl -n=default get "$operator_pod_name" -o jsonpath='{.status.containerStatuses[0].ready}')
if [ "$operator_pod_is_ready" == "true" ]; then
((operator_pod_ready_cycles++))
else
operator_pod_ready_cycles=0
Expand Down Expand Up @@ -414,11 +430,11 @@ function validate_cortex() {
fi

if [ "$CORTEX_OPERATOR_LOAD_BALANCER_SCHEME" == "internet-facing" ]; then
if [ "$operator_endpoint_reachable" != "ready" ]; then
if [ "$operator_endpoint_reachable" != "true" ]; then
if ! curl --max-time 3 $operator_endpoint >/dev/null 2>&1; then
continue
fi
operator_endpoint_reachable="ready"
operator_endpoint_reachable="true"
fi
fi

Expand Down