diff --git a/.github/actions/kots-gke-create/action.yml b/.github/actions/kots-gke-create/action.yml deleted file mode 100644 index 82b0cb9f23..0000000000 --- a/.github/actions/kots-gke-create/action.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: 'KOTS GKE Create' -description: 'Composite action for creating a GKE cluster for KOTS tests' -inputs: - service-key: - description: 'Service key to authenticate a Google Cloud service account' - required: false - - cluster-region: - description: GKE cluster region to use - default: 'us-west1' - required: false - - cluster-network: - description: GKE cluster network tag - default: 'projects/replicated-qa/global/networks/default' - required: false - - cluster-subnetwork: - description: GKE cluster subnetwork tag - default: 'projects/replicated-qa/regions/us-west1/subnetworks/default' - required: false - - project: - description: Google Cloud project name - default: 'replicated-qa' - required: false - -runs: - using: "composite" - steps: - - name: Generate GKE cluster name - id: cluster-name - shell: bash - run: | - echo "cluster_name=kots-ci-${{ github.run_id }}-${{ github.run_attempt }}-$(echo '${{ github.job }}' | cut -c -18)" >> $GITHUB_OUTPUT - - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ inputs.service-key }} - - - name: Setup Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - with: - install_components: 'gke-gcloud-auth-plugin' - - - name: Create the GKE cluster - shell: bash - run: | - gcloud container clusters create-auto "${{ steps.cluster-name.outputs.cluster_name }}" --project "${{ inputs.project }}" --region "${{ inputs.cluster-region }}" --network "${{ inputs.cluster-network }}" --subnetwork "${{ inputs.cluster-subnetwork }}" - gcloud container clusters update "${{ steps.cluster-name.outputs.cluster_name }}" --project "${{ inputs.project }}" --region "${{ inputs.cluster-region }}" --update-labels=expires-on=$(date "+%F" -d "+24 hours") - - - name: Get GKE cluster credentials for kubectl - uses: google-github-actions/get-gke-credentials@v1 - with: - cluster_name: ${{ steps.cluster-name.outputs.cluster_name }} - location: ${{ inputs.cluster-region }} - project_id: ${{ inputs.project }} diff --git a/.github/actions/kots-gke-create/reserve-capacity.yaml b/.github/actions/kots-gke-create/reserve-capacity.yaml deleted file mode 100644 index 92661784e8..0000000000 --- a/.github/actions/kots-gke-create/reserve-capacity.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: scheduling.k8s.io/v1 -kind: PriorityClass -metadata: - name: low-priority -value: -10 -preemptionPolicy: Never -globalDefault: false -description: "Low priority workloads" ---- -apiVersion: scheduling.k8s.io/v1 -kind: PriorityClass -metadata: - name: default-priority -value: 0 -preemptionPolicy: PreemptLowerPriority -globalDefault: true -description: "The global default priority." ---- -apiVersion: batch/v1 -kind: Job -metadata: - name: capacity-res-job -spec: - parallelism: 4 - backoffLimit: 6 - template: - metadata: - labels: - app: capacity-res-job - spec: - priorityClassName: low-priority - terminationGracePeriodSeconds: 0 - containers: - - name: busybox - image: busybox - command: ["sh", "-c", "sleep 3600"] - resources: - requests: - cpu: "250m" - restartPolicy: Never diff --git a/.github/actions/kots-gke-delete/action.yml b/.github/actions/kots-gke-delete/action.yml deleted file mode 100644 index 88bb3f00b8..0000000000 --- a/.github/actions/kots-gke-delete/action.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: 'KOTS GKE Delete' -description: 'Composite action for deleting a GKE cluster used for KOTS tests' -inputs: - service-key: - description: 'Service key to authenticate a Google Cloud service account' - required: false - - cluster-region: - description: GKE cluster region to use - default: 'us-west1' - required: false - - project: - description: Google Cloud project name - default: 'replicated-qa' - required: false - -runs: - using: "composite" - steps: - - name: Generate GKE cluster name - id: cluster-name - shell: bash - run: | - echo "cluster_name=kots-ci-${{ github.run_id }}-${{ github.run_attempt }}-$(echo '${{ github.job }}' | cut -c -18)" >> $GITHUB_OUTPUT - - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ inputs.service-key }} - - - name: Setup Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - with: - install_components: 'gke-gcloud-auth-plugin' - - - name: Get GKE cluster credentials for kubectl - uses: google-github-actions/get-gke-credentials@v1 - with: - cluster_name: ${{ steps.cluster-name.outputs.cluster_name }} - location: ${{ inputs.cluster-region }} - project_id: ${{ inputs.project }} - - - name: Delete GKE cluster if flagged - shell: bash - run: | - gcloud -q container clusters delete "${{ steps.cluster-name.outputs.cluster_name }}" --project "${{ inputs.project }}" --region "${{ inputs.cluster-region }}" diff --git a/.github/workflows/arm64-self-hosted-runner.yaml b/.github/workflows/arm64-self-hosted-runner.yaml index 860a684def..793fb98a57 100644 --- a/.github/workflows/arm64-self-hosted-runner.yaml +++ b/.github/workflows/arm64-self-hosted-runner.yaml @@ -24,7 +24,7 @@ jobs: mv /tmp/replicated /usr/local/bin/replicated - name: Remove existing CMX Cluster - run: replicated cluster rm --name $CLUSTER_NAME --token '${{ secrets.C11Y_MATRIX_TOKEN }}' + run: replicated cluster rm --name "$CLUSTER_NAME" --token '${{ secrets.C11Y_MATRIX_TOKEN }}' - name: Create new CMX Cluster run: | @@ -34,13 +34,13 @@ jobs: --token '${{ secrets.C11Y_MATRIX_TOKEN }}' \ --distribution eks \ --instance-type m7g.2xlarge \ - --name $CLUSTER_NAME \ + --name "$CLUSTER_NAME" \ --ttl 144h \ --wait 120m replicated cluster kubeconfig \ --token '${{ secrets.C11Y_MATRIX_TOKEN }}' \ - --name $CLUSTER_NAME + --name "$CLUSTER_NAME" # reference: https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/quickstart-for-actions-runner-controller - name: Setup Actions Runner Controller (ARC) @@ -52,13 +52,9 @@ jobs: --create-namespace \ oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set-controller - kubectl create namespace arc-runners - kubectl create secret generic github-config-secret \ - --namespace=arc-runners \ - --from-literal=github_token="${{ secrets.GITHUB_TOKEN }}" - helm install arc-runner-set \ --namespace arc-runners \ + --create-namespace \ --set githubConfigUrl="https://github.com/replicatedhq/kots" \ - --set githubConfigSecret="github-config-secret" \ + --set githubConfigSecret.github_token="${{ secrets.GITHUB_TOKEN }}" \ oci://ghcr.io/actions/actions-runner-controller-charts/gha-runner-scale-set