Skip to content

Commit bf3ccd6

Browse files
Merge pull request #6189 from wking/aws-console-logs
ci-operator/templates/openshift/installer/cluster-launch-installer-e2e: Gather node console logs on AWS
2 parents b47ce3e + e102a16 commit bf3ccd6

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,10 @@ objects:
711711
value: /etc/openshift-installer/gce.json
712712
- name: KUBECONFIG
713713
value: /tmp/artifacts/installer/auth/kubeconfig
714+
- name: USER
715+
value: test
716+
- name: HOME
717+
value: /tmp
714718
command:
715719
- /bin/bash
716720
- -c
@@ -778,6 +782,7 @@ objects:
778782
fi
779783
780784
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.metadata.name}{"\n"}{end}' > /tmp/nodes
785+
oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o jsonpath --template '{range .items[*]}{.spec.providerID}{"\n"}{end}' | sed 's|.*/||' > /tmp/node-provider-IDs
781786
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers
782787
oc --insecure-skip-tls-verify --request-timeout=5s get pods -l openshift.io/component=api --all-namespaces --template '{{ range .items }}-n {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}' > /tmp/pods-api
783788
@@ -818,6 +823,21 @@ objects:
818823
queue /tmp/artifacts/nodes/$i/heap oc --insecure-skip-tls-verify get --request-timeout=20s --raw /api/v1/nodes/$i/proxy/debug/pprof/heap
819824
done < /tmp/nodes
820825
826+
if [[ "${CLUSTER_TYPE}" = "aws" ]]; then
827+
# FIXME: get epel-release or otherwise add awscli to our teardown image
828+
export PATH="${HOME}/.local/bin:${PATH}"
829+
easy_install --user pip # our Python 2.7.5 is even too old for ensurepip
830+
pip install --user awscli
831+
export AWS_REGION="$(python -c 'import json; data = json.load(open("/tmp/artifacts/installer/metadata.json")); print(data["aws"]["region"])')"
832+
fi
833+
834+
while IFS= read -r i; do
835+
mkdir -p "/tmp/artifacts/nodes/${i}"
836+
if [[ "${CLUSTER_TYPE}" = "aws" ]]; then
837+
queue /tmp/artifacts/nodes/$i/console aws ec2 get-console-output --instance-id "${i}"
838+
fi
839+
done < /tmp/node-provider-IDs
840+
821841
FILTER=gzip queue /tmp/artifacts/nodes/masters-journal.gz oc --insecure-skip-tls-verify adm node-logs --role=master --unify=false
822842
FILTER=gzip queue /tmp/artifacts/nodes/workers-journal.gz oc --insecure-skip-tls-verify adm node-logs --role=worker --unify=false
823843

0 commit comments

Comments
 (0)