From 0721d978e9be1ca13f4c56e5e54b02e673518b65 Mon Sep 17 00:00:00 2001 From: bennerv <19840174+bennerv@users.noreply.github.com> Date: Fri, 6 Nov 2020 12:52:12 -0500 Subject: [PATCH] Update docs and ssh-agent.sh usage and checks to ensure CLUSTER is specified Change mycluster to cluster example usage Minor refactors --- docs/deploy-development-rp.md | 14 +++++++------- hack/ssh-agent.sh | 11 ++++++++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/docs/deploy-development-rp.md b/docs/deploy-development-rp.md index ef33b69eb..009e26e91 100644 --- a/docs/deploy-development-rp.md +++ b/docs/deploy-development-rp.md @@ -12,7 +12,7 @@ package is called `python-virtualenv` on both Fedora and Debian-based systems. -1. Fedora users: install the `gpgme-devel` and `libassuan-devel` packages. +1. Fedora users: install the `gpgme-devel`, `libassuan-devel`, and `openssl` packages. Debian users: install the `libgpgme-dev` package. @@ -150,13 +150,13 @@ OR use the create utility: ```bash - CLUSTER=mycluster go run ./hack/cluster create + CLUSTER=cluster go run ./hack/cluster create ``` Later the cluster can be deleted as follows: ```bash - CLUSTER=mycluster go run ./hack/cluster delete + CLUSTER=cluster go run ./hack/cluster delete ``` [1]: https://docs.microsoft.com/en-us/azure/openshift/tutorial-create-cluster @@ -189,16 +189,16 @@ ## Debugging * SSH to the bootstrap node: - +> __NOTE:__ If you have a password-based `sudo` command, you must first authenticate before running `sudo` in the background ```bash sudo openvpn secrets/vpn-$LOCATION.ovpn & - hack/ssh-agent.sh bootstrap + CLUSTER=cluster hack/ssh-agent.sh bootstrap ``` * Get an admin kubeconfig: ```bash - make admin.kubeconfig + CLUSTER=cluster make admin.kubeconfig export KUBECONFIG=admin.kubeconfig ``` @@ -207,7 +207,7 @@ * First, get the admin kubeconfig and `export KUBECONFIG` as detailed above. ```bash - hack/ssh-agent.sh [master-{0,1,2}] + CLUSTER=cluster hack/ssh-agent.sh [master-{0,1,2}] ``` diff --git a/hack/ssh-agent.sh b/hack/ssh-agent.sh index 71d83df0b..898207ec9 100755 --- a/hack/ssh-agent.sh +++ b/hack/ssh-agent.sh @@ -5,9 +5,9 @@ # you want to pass in usage() { - echo "usage: $0 hostname_pattern" >&2 - echo " Examples: $0 master1" >&2 - echo " $0 bootstrap" >&2 + echo "usage: CLUSTER=cluster $0 hostname_pattern" >&2 + echo " Examples: CLUSTER=cluster $0 master1" >&2 + echo " CLUSTER=cluster $0 bootstrap" >&2 exit 1 } @@ -24,6 +24,11 @@ trap cleanup EXIT eval "$(ssh-agent | grep -v '^echo ')" +if [[ -z "$CLUSTER" ]]; then + echo "CLUSTER must be specified" + usage +fi + if [[ -z "$RESOURCEID" ]]; then RESOURCEID="/subscriptions/${AZURE_SUBSCRIPTION_ID}/resourceGroups/${RESOURCEGROUP}/providers/Microsoft.RedHatOpenShift/openShiftClusters/${CLUSTER}" fi