From 9d311ed6bd58c2265f419b78ffb8f13cce871e46 Mon Sep 17 00:00:00 2001 From: Connor Catlett Date: Tue, 11 Apr 2023 17:15:11 +0000 Subject: [PATCH] Remove SSH from CI SSH access is completely unnecessary for CI and introduces a potential flake point. Signed-off-by: Connor Catlett --- hack/e2e/eksctl.sh | 26 +++++++++++--------------- hack/e2e/kops.sh | 27 +++++++++++---------------- hack/e2e/run.sh | 3 --- 3 files changed, 22 insertions(+), 34 deletions(-) diff --git a/hack/e2e/eksctl.sh b/hack/e2e/eksctl.sh index d8760ecb5e..83fabc7feb 100644 --- a/hack/e2e/eksctl.sh +++ b/hack/e2e/eksctl.sh @@ -13,19 +13,16 @@ function eksctl_install() { } function eksctl_create_cluster() { - SSH_KEY_PATH=${1} - CLUSTER_NAME=${2} - BIN=${3} - ZONES=${4} - INSTANCE_TYPE=${5} - K8S_VERSION=${6} - CLUSTER_FILE=${7} - KUBECONFIG=${8} - EKSCTL_PATCH_FILE=${9} - EKSCTL_ADMIN_ROLE=${10} - WINDOWS=${11} - - generate_ssh_key "${SSH_KEY_PATH}" + CLUSTER_NAME=${1} + BIN=${2} + ZONES=${3} + INSTANCE_TYPE=${4} + K8S_VERSION=${5} + CLUSTER_FILE=${6} + KUBECONFIG=${7} + EKSCTL_PATCH_FILE=${8} + EKSCTL_ADMIN_ROLE=${9} + WINDOWS=${10} CLUSTER_NAME="${CLUSTER_NAME//./-}" @@ -36,8 +33,7 @@ function eksctl_create_cluster() { loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE (dry run)" ${BIN} create cluster \ --managed \ - --ssh-access \ - --ssh-public-key "${SSH_KEY_PATH}".pub \ + --ssh-access=false \ --zones "${ZONES}" \ --nodes=3 \ --instance-types="${INSTANCE_TYPE}" \ diff --git a/hack/e2e/kops.sh b/hack/e2e/kops.sh index 52c9b3f147..a2bfb82a70 100644 --- a/hack/e2e/kops.sh +++ b/hack/e2e/kops.sh @@ -23,20 +23,17 @@ function kops_install() { } function kops_create_cluster() { - SSH_KEY_PATH=${1} - CLUSTER_NAME=${2} - BIN=${3} - ZONES=${4} - NODE_COUNT=${5} - INSTANCE_TYPE=${6} - K8S_VERSION=${7} - CLUSTER_FILE=${8} - KUBECONFIG=${9} - KOPS_PATCH_FILE=${10} - KOPS_PATCH_NODE_FILE=${11} - KOPS_STATE_FILE=${12} - - generate_ssh_key "${SSH_KEY_PATH}" + CLUSTER_NAME=${1} + BIN=${2} + ZONES=${3} + NODE_COUNT=${4} + INSTANCE_TYPE=${5} + K8S_VERSION=${6} + CLUSTER_FILE=${7} + KUBECONFIG=${8} + KOPS_PATCH_FILE=${9} + KOPS_PATCH_NODE_FILE=${10} + KOPS_STATE_FILE=${11} if kops_cluster_exists "${CLUSTER_NAME}" "${BIN}" "${KOPS_STATE_FILE}"; then loudecho "Replacing cluster $CLUSTER_NAME with $CLUSTER_FILE" @@ -44,7 +41,6 @@ function kops_create_cluster() { else loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE (dry run)" ${BIN} create cluster --state "${KOPS_STATE_FILE}" \ - --ssh-public-key="${SSH_KEY_PATH}".pub \ --zones "${ZONES}" \ --node-count="${NODE_COUNT}" \ --node-size="${INSTANCE_TYPE}" \ @@ -62,7 +58,6 @@ function kops_create_cluster() { loudecho "Creating cluster $CLUSTER_NAME with $CLUSTER_FILE" ${BIN} create --state "${KOPS_STATE_FILE}" -f "${CLUSTER_FILE}" - kops create secret --state "${KOPS_STATE_FILE}" --name "${CLUSTER_NAME}" sshpublickey admin -i "${SSH_KEY_PATH}".pub fi loudecho "Updating cluster $CLUSTER_NAME with $CLUSTER_FILE" diff --git a/hack/e2e/run.sh b/hack/e2e/run.sh index fd4b183ce6..e92a6ef84e 100755 --- a/hack/e2e/run.sh +++ b/hack/e2e/run.sh @@ -34,7 +34,6 @@ CLUSTER_TYPE=${CLUSTER_TYPE:-kops} TEST_DIR=${BASE_DIR}/csi-test-artifacts BIN_DIR=${TEST_DIR}/bin -SSH_KEY_PATH=${TEST_DIR}/id_rsa CLUSTER_FILE=${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.yaml KUBECONFIG=${KUBECONFIG:-"${TEST_DIR}/${CLUSTER_NAME}.${CLUSTER_TYPE}.kubeconfig"} @@ -131,7 +130,6 @@ ecr_build_and_push "${REGION}" \ if [[ "${CLUSTER_TYPE}" == "kops" ]]; then kops_create_cluster \ - "$SSH_KEY_PATH" \ "$CLUSTER_NAME" \ "$KOPS_BIN" \ "$ZONES" \ @@ -148,7 +146,6 @@ if [[ "${CLUSTER_TYPE}" == "kops" ]]; then fi elif [[ "${CLUSTER_TYPE}" == "eksctl" ]]; then eksctl_create_cluster \ - "$SSH_KEY_PATH" \ "$CLUSTER_NAME" \ "$EKSCTL_BIN" \ "$ZONES" \