From 43dde9e75117a468f3a506dec1fd16e5dc510a15 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 23 Dec 2018 19:33:37 -0500 Subject: [PATCH] Set KUBE_SSH_BASTION and KUBE_SSH_KEY_PATH in installer tests We will start using the bastion to do tunneling to workers via SSH tests in 4.0. Leave all existing variables in place. Fix a few places of config drift from the installer src to e2e tests. --- .../installer/cluster-launch-installer-e2e.yaml | 5 +++++ .../installer/cluster-launch-installer-src.yaml | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml index a27c6d29b2d31..78518f83a6e23 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml @@ -92,6 +92,8 @@ objects: - name: artifacts mountPath: /tmp/artifacts env: + - name: ARTIFACT_DIR + value: /tmp/artifacts - name: HOME value: /tmp/home - name: KUBECONFIG @@ -191,6 +193,9 @@ objects: # oh god the blood sleep 180 + export KUBE_SSH_BASTION="$( oc get node -l node-role.kubernetes.io/master -o 'jsonpath={.items[0].status.addresses[?(@.type=="ExternalIP")].address}' ):22" + export KUBE_SSH_KEY_PATH=/tmp/cluster/ssh-privatekey + # set up cloud-provider-specific env vars if [[ "${CLUSTER_TYPE}" == "gcp" ]]; then export GOOGLE_APPLICATION_CREDENTIALS="/tmp/cluster/gce.json" diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml index 8ee35741dc02d..b8223bf3cde52 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml @@ -87,8 +87,8 @@ objects: - name: artifacts mountPath: /tmp/artifacts env: - - name: INSTANCE_PREFIX - value: ${NAMESPACE}-${JOB_NAME_HASH} + - name: ARTIFACT_DIR + value: /tmp/artifacts - name: HOME value: /tmp/home - name: KUBECONFIG @@ -104,7 +104,9 @@ objects: trap 'touch /tmp/shared/exit' EXIT trap 'kill $(jobs -p); exit 0' TERM - + + cp "$(which oc)" /tmp/shared/ + mkdir -p "${HOME}" # wait for the router namespace @@ -127,7 +129,6 @@ objects: # don't let clients impact the global kubeconfig cp "${KUBECONFIG}" /tmp/admin.kubeconfig export KUBECONFIG=/tmp/admin.kubeconfig - export ARTIFACT_DIR=/tmp/artifacts fi if ! oc get nodes 2>/dev/null; then echo "Waiting for API at $(oc whoami --show-server) to respond ..." @@ -187,6 +188,9 @@ objects: # oh god the blood sleep 180 + export KUBE_SSH_BASTION="$( oc get node -l node-role.kubernetes.io/master -o 'jsonpath={.items[0].status.addresses[?(@.type=="ExternalIP")].address}' ):22" + export KUBE_SSH_KEY_PATH=/tmp/cluster/ssh-privatekey + # set up cloud-provider-specific env vars if [[ "${CLUSTER_TYPE}" == "gcp" ]]; then export GOOGLE_APPLICATION_CREDENTIALS="/tmp/cluster/gce.json" @@ -205,7 +209,7 @@ objects: mkdir -p ~/.ssh cp /tmp/cluster/ssh-privatekey ~/.ssh/kube_openstack_rsa || true fi - + ${TEST_COMMAND} # Runs an install