зеркало из https://github.com/Azure/ARO-RP.git
add "ssh" tool
This commit is contained in:
Родитель
198c570917
Коммит
427c9783ef
|
@ -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]
|
||||
```
|
||||
|
|
|
@ -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"
|
Загрузка…
Ссылка в новой задаче