This commit is contained in:
Jim Minter 2019-12-20 12:43:52 -06:00
Родитель 198c570917
Коммит 427c9783ef
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0730CBDA10D1A2D3
2 изменённых файлов: 62 добавлений и 2 удалений

Просмотреть файл

@ -233,6 +233,12 @@
## Debugging
* SSH to the bootstrap node:
```
hack/ssh-bootstrap.sh "/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.RedHatOpenShift/openShiftClusters/$CLUSTER"
```
* Get an admin kubeconfig:
```
@ -241,8 +247,8 @@
oc version
```
* SSH to the bootstrap node:
* "SSH" to a cluster node:
```
hack/ssh-bootstrap.sh "/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$RESOURCEGROUP/providers/Microsoft.RedHatOpenShift/openShiftClusters/$CLUSTER"
hack/ssh.sh [aro-master-0]
```

54
hack/ssh.sh Executable file
Просмотреть файл

@ -0,0 +1,54 @@
#!/bin/bash -e
if [[ ! -e admin.kubeconfig ]]; then
echo "run hack/get-admin-kubeconfig.sh first" >&2
exit 1
fi
export KUBECONFIG=admin.kubeconfig
NODENAME=aro-master-0
[[ "$#" -gt 0 ]] && NODENAME=$1
cleanup() {
[[ -n "$POD" ]] && oc delete pod -n default "$POD" >/dev/null
}
trap cleanup EXIT
POD=$(oc create -o json -f - <<EOF | jq -r .metadata.name
kind: Pod
apiVersion: v1
metadata:
generateName: debug
namespace: default
spec:
containers:
- command:
- /sbin/chroot
- /host
- /bin/bash
- -c
- "cd && exec bash --login"
image: ubi8/ubi-minimal
name: debug
stdin: true
tty: true
volumeMounts:
- mountPath: /host
name: host
hostIPC: true
hostNetwork: true
hostPID: true
nodeName: $NODENAME
restartPolicy: Never
terminationGracePeriodSeconds: 0
volumes:
- hostPath:
path: /
name: host
EOF
)
oc wait --for=condition=Ready "pod/$POD" >/dev/null
oc attach -it -n default -c debug "pod/$POD"