-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dedicated workflow for deleting clusters (#391)
*Issue #, if available:* N/A *Description of changes:* Adds a manual workflow for cleaning up a cluster By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Manual cluster cleanup | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: "Github Environment" | ||
|
||
concurrency: | ||
group: e2e-cluster-${{ inputs.environment }} | ||
|
||
env: | ||
IMAGE_NAME: "s3-csi-driver" | ||
BENCHMARK_ARTIFACTS_FOLDER: ".github/artifacts" | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
KOPS_STATE_FILE: "s3://${{ vars.KOPS_STATE_FILE }}" | ||
BENCHMARK_BUCKET: "s3://${{ vars.BENCHMARK_BUCKET }}" | ||
jobs: | ||
build_matrix: | ||
name: Build Matrix | ||
uses: ./.github/workflows/build_matrix.yaml | ||
delete_cluster: | ||
needs: [ "build_matrix" ] | ||
strategy: | ||
# Failing fast causes some resources created during the test to leak, | ||
# so we disable it to ensure all resources created during test are properly cleaned up. | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.build_matrix.outputs.matrix) }} | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
env: | ||
AWS_REGION: "${{ vars.AWS_REGION }}" | ||
CLUSTER_TYPE: "${{ matrix.cluster-type }}" | ||
ARCH: "${{ matrix.arch }}" | ||
AMI_FAMILY: "${{ matrix.family }}" | ||
# envtest doesn't support all versions, here K8S_VERSION is a full version like 1.28.13, | ||
# and in order to get latest supported version by envtest we convert it to 1.28. | ||
K8S_VERSION: "${{ matrix.kubernetes-version }}" | ||
ENVTEST_K8S_VERSION: "${K8S_VERSION%.*}" | ||
SELINUX_MODE: "${{ matrix.selinux-mode }}" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.ref }} | ||
persist-credentials: false | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: "go.mod" | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ vars.IAM_ROLE }} | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-duration-seconds: 7200 | ||
- name: Install tools | ||
env: | ||
ACTION: "install_tools" | ||
run: | | ||
tests/e2e-kubernetes/scripts/run.sh | ||
- name: Delete cluster | ||
env: | ||
ACTION: "delete_cluster" | ||
run: | | ||
tests/e2e-kubernetes/scripts/run.sh |