mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Merge pull request #55690 from porridge/debug-curl
Automatic merge from submit-queue (batch tested with PRs 56208, 55690). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Dump last curl output if cluster fails to come up. **What this PR does / why we need it**: This is a step toward solving #55686 **Release note**: ```release-note NONE ```
This commit is contained in:
commit
fff99b72b9
@ -1526,14 +1526,20 @@ function check-cluster() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local start_time=$(date +%s)
|
local start_time=$(date +%s)
|
||||||
|
local curl_out=$(mktemp)
|
||||||
|
kube::util::trap_add "rm -f ${curl_out}" EXIT
|
||||||
until curl --cacert "${CERT_DIR}/pki/ca.crt" \
|
until curl --cacert "${CERT_DIR}/pki/ca.crt" \
|
||||||
-H "Authorization: Bearer ${KUBE_BEARER_TOKEN}" \
|
-H "Authorization: Bearer ${KUBE_BEARER_TOKEN}" \
|
||||||
${secure} \
|
${secure} \
|
||||||
--max-time 5 --fail --output /dev/null --silent \
|
--max-time 5 --fail \
|
||||||
"https://${KUBE_MASTER_IP}/api/v1/pods"; do
|
"https://${KUBE_MASTER_IP}/api/v1/pods" > "${curl_out}" 2>&1; do
|
||||||
local elapsed=$(($(date +%s) - ${start_time}))
|
local elapsed=$(($(date +%s) - ${start_time}))
|
||||||
if [[ ${elapsed} -gt ${KUBE_CLUSTER_INITIALIZATION_TIMEOUT} ]]; then
|
if [[ ${elapsed} -gt ${KUBE_CLUSTER_INITIALIZATION_TIMEOUT} ]]; then
|
||||||
echo -e "${color_red}Cluster failed to initialize within ${KUBE_CLUSTER_INITIALIZATION_TIMEOUT} seconds.${color_norm}" >&2
|
echo -e "${color_red}Cluster failed to initialize within ${KUBE_CLUSTER_INITIALIZATION_TIMEOUT} seconds.${color_norm}" >&2
|
||||||
|
echo "Last output from querying API server follows:" >&2
|
||||||
|
echo "-----------------------------------------------------" >&2
|
||||||
|
cat "${curl_out}" >&2
|
||||||
|
echo "-----------------------------------------------------" >&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
printf "."
|
printf "."
|
||||||
|
Loading…
Reference in New Issue
Block a user