Skip to content

Commit

Permalink
Merge pull request #1566 from ConnorJC3/goodbye-ssh
Browse files Browse the repository at this point in the history
[ANTI-FLAKE] Remove SSH from CI
  • Loading branch information
k8s-ci-robot authored Apr 11, 2023
2 parents 4e96fd3 + 9d311ed commit e5ccff6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 34 deletions.
26 changes: 11 additions & 15 deletions hack/e2e/eksctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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//./-}"

Expand All @@ -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}" \
Expand Down
27 changes: 11 additions & 16 deletions hack/e2e/kops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,24 @@ 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"
${BIN} replace --state "${KOPS_STATE_FILE}" -f "${CLUSTER_FILE}"
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}" \
Expand All @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions hack/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down Expand Up @@ -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" \
Expand All @@ -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" \
Expand Down

0 comments on commit e5ccff6

Please sign in to comment.