Skip to content

Test EKS Cluster

Test EKS Cluster #573

Workflow file for this run

name: Test EKS Cluster
on:
schedule:
- cron: '0 7 * * * ' ## Every day at 0700 UTC
workflow_dispatch: ## Give us the ability to run this manually
inputs:
cluster_name:
type: string
default: zarf-nightly-eks-e2e-test
description: Name of the eks cluster that the test will create
instance_type:
type: string
default: t3.medium
description: EC2 instance type to use for the EKS cluster nodes
permissions:
id-token: write
contents: read
# Abort prior jobs in the same workflow / PR
concurrency:
group: e2e-eks-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Setup golang
uses: ./.github/actions/golang
- name: Setup NodeJS
uses: ./.github/actions/node
- name: Build binary and zarf packages
uses: ./.github/actions/packages
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0
with:
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }}
aws-region: us-east-1
role-duration-seconds: 14400
- name: Build the eks package
run: ./build/zarf package create packages/distros/eks -o build --confirm
- name: Deploy the eks package
run: ./build/zarf package deploy build/zarf-package-distro-eks-multi-0.0.2.tar.zst --components=deploy-eks-cluster --set=CLUSTER_NAME=${{ inputs.cluster_name || 'zarf-nightly-eks-e2e-test' }},INSTANCE_TYPE=${{ inputs.instance_type || 't3.medium' }} --confirm
# NOTE: We are copying the secret because part of the e2e process destroys the `zarf` namespace. We still want to test the remove-ability of the eks cluster via the package.
- name: Copy the eks secret into a local file
run: |
rm -f eks.yaml
./build/zarf tools kubectl get secret -n zarf zarf-eks-yaml -o jsonpath='{.data.*}' | base64 -d > eks.yaml
- name: Run tests
run: make test-e2e ARCH=amd64
# NOTE: We are copying the secret because part of the e2e process destroys the `zarf` namespace. We still want to test the remove-ability of the eks cluster via the package.
- name: Re-create zarf namespace with eks.yaml secret
run: |
./build/zarf tools kubectl create secret generic zarf-eks-yaml -n zarf --from-file=eks.yaml
- name: Teardown the cluster
if: always()
run: ./build/zarf package deploy build/zarf-package-distro-eks-multi-0.0.2.tar.zst --components=teardown-eks-cluster --confirm
- name: Save logs
if: always()
uses: ./.github/actions/save-logs