File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ On CI runs, provide additional context when 'helmfile install' fails.
Original file line number Diff line number Diff line change @@ -49,7 +49,20 @@ export FEDERATION_DOMAIN_2="federation-test-helper.$FEDERATION_DOMAIN_BASE"
4949
5050echo " Installing charts..."
5151
52+ set +e
5253helmfile --environment " $HELMFILE_ENV " --file " ${TOP_LEVEL} /hack/helmfile.yaml" sync --skip-deps --concurrency 0
54+ EXIT_CODE=$?
55+
56+ if (( EXIT_CODE > 0 )) ; then
57+ echo " !! Helm install failed. Attempting to get some more information ..."
58+
59+ kubectl -n " $NAMESPACE_1 " get events | grep -v " Normal "
60+ kubectl -n " $NAMESPACE_2 " get events | grep -v " Normal "
61+ " ${DIR} /kubectl-get-debug-info.sh" " $NAMESPACE_1 "
62+ " ${DIR} /kubectl-get-debug-info.sh" " $NAMESPACE_2 "
63+ exit $EXIT_CODE
64+ fi
65+ set -e
5366
5467# wait for fakeSNS to create resources. TODO, cleaner: make initiate-fake-aws-sns a post hook. See cassandra-migrations chart for an example.
5568resourcesReady () {
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ USAGE=" $0 <NAMESPACE>"
4+ NAMESPACE=${1:? $USAGE }
5+
6+ echo " Checking pods in namespace '${NAMESPACE} ' that failed to schedule..."
7+
8+ # Get pods that failed to schedule
9+ UNSCHEDULED_PODS=$( kubectl get pods --namespace " $NAMESPACE " -o json | jq -r ' .items[] | select(.status.phase=="Pending") | .metadata.name' )
10+
11+ for POD in $UNSCHEDULED_PODS ; do
12+ echo " Pod $POD failed to schedule for the following reasons:"
13+ # Get events for pod
14+ kubectl describe pod " $POD " --namespace " $NAMESPACE " | grep -A 10 " Events:"
15+ echo " "
16+ done
17+
18+ echo " Checking pods in namespace '${NAMESPACE} ' that are crashlooping..."
19+
20+ # Get pods that are crashlooping
21+ CRASHLOOPING_PODS=$( kubectl get pods --namespace " $NAMESPACE " -o json | jq -r ' .items[] | select(.status.containerStatuses[]?.state.waiting.reason=="CrashLoopBackOff") | .metadata.name' )
22+
23+ for POD in $CRASHLOOPING_PODS ; do
24+ echo " Pod $POD is crashlooping for the following reasons:"
25+ # Get logs of previous run for pod
26+ kubectl logs " $POD " --namespace " $NAMESPACE " --previous
27+ echo " "
28+ done
29+
You can’t perform that action at this time.
0 commit comments