Skip to content

Commit

Permalink
Merge pull request kubernetes#4252 from satnam6502/kubeup
Browse files Browse the repository at this point in the history
Report more information about nodes during cluster validation
  • Loading branch information
roberthbailey committed Feb 9, 2015
2 parents 301eba9 + a57d4c5 commit a84e945
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cluster/validate-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ get-password
detect-master > /dev/null
detect-minions > /dev/null

MINIONS_FILE=/tmp/minions
MINIONS_FILE=/tmp/minions-$$
trap 'rm -rf "${MINIONS_FILE}"' EXIT
# Make several attempts to deal with slow cluster birth.
attempt=0
while true; do
Expand All @@ -43,14 +44,15 @@ while true; do
else
if (( attempt > 5 )); then
echo -e "${color_red}Detected ${found} nodes out of ${NUM_MINIONS}. Your cluster may not be working. ${color_norm}"
cat -n "${MINIONS_FILE}"
exit 2
fi
attempt=$((attempt+1))
sleep 30
fi
done
echo "Found ${found} nodes."
cat "${MINIONS_FILE}"
cat -n "${MINIONS_FILE}"

# On vSphere, use minion IPs as their names
if [[ "${KUBERNETES_PROVIDER}" == "vsphere" ]] || [[ "${KUBERNETES_PROVIDER}" == "vagrant" ]]; then
Expand All @@ -62,6 +64,7 @@ for (( i=0; i<${#MINION_NAMES[@]}; i++)); do
count=$(grep -c "${MINION_NAMES[$i]}" "${MINIONS_FILE}") || :
if [[ "${count}" == "0" ]]; then
echo -e "${color_red}Failed to find ${MINION_NAMES[$i]}, cluster is probably broken.${color_norm}"
cat -n "${MINIONS_FILE}"
exit 1
fi

Expand Down

0 comments on commit a84e945

Please sign in to comment.