mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-28 19:54:35 +00:00
gha: k8s-on-aks: {create,delete} AKS must be a coded-in step
I should have seen this coming, but currently the "create" and "delete" AKS workflows cannot be imported and uses as a job's step, resulting on an error trying to find the correspondent action.yaml file for those. Fixes: #6630 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
ee5dda012b
commit
79f3047f06
32
.github/workflows/create-aks.yaml
vendored
32
.github/workflows/create-aks.yaml
vendored
@ -1,32 +0,0 @@
|
||||
name: CI | Create AKS cluster
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
name:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
create-aks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Azure CLI
|
||||
run: |
|
||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||
|
||||
- name: Log into the Azure account
|
||||
run: |
|
||||
az login \
|
||||
--service-principal \
|
||||
-u "${{ secrets.AZ_APPID }}" \
|
||||
-p "${{ secrets.AZ_PASSWORD }}" \
|
||||
--tenant "${{ secrets.AZ_TENANT_ID }}"
|
||||
|
||||
- name: Create AKS cluster
|
||||
run: |
|
||||
az aks create \
|
||||
-g "kataCI" \
|
||||
-n "${{ inputs.name }}" \
|
||||
-s "Standard_D4s_v5" \
|
||||
--node-count 1 \
|
||||
--generate-ssh-keys
|
31
.github/workflows/delete-aks.yaml
vendored
31
.github/workflows/delete-aks.yaml
vendored
@ -1,31 +0,0 @@
|
||||
name: CI | Delete AKS cluster
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
name:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
delete-aks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download Azure CLI
|
||||
run: |
|
||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||
|
||||
- name: Log into the Azure account
|
||||
run: |
|
||||
az login \
|
||||
--service-principal \
|
||||
-u "${{ secrets.AZ_APPID }}" \
|
||||
-p "${{ secrets.AZ_PASSWORD }}" \
|
||||
--tenant "${{ secrets.AZ_TENANT_ID }}"
|
||||
|
||||
- name: Delete AKS cluster
|
||||
run: |
|
||||
az aks delete \
|
||||
-g "kataCI" \
|
||||
-n "${{ inputs.name }}" \
|
||||
--yes \
|
||||
--no-wait
|
43
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
43
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
@ -23,22 +23,13 @@ jobs:
|
||||
- qemu
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create AKS cluster to test ${{ matrix.vmm }}
|
||||
uses: ./.github/workflows-create-aks.yaml
|
||||
with:
|
||||
name: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Install `bats`
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install bats
|
||||
|
||||
- name: Install `kubectl`
|
||||
- name: Download Azure CLI
|
||||
run: |
|
||||
sudo az aks install-cli
|
||||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||
|
||||
- name: Log into the Azure account
|
||||
run: |
|
||||
@ -48,6 +39,24 @@ jobs:
|
||||
-p "${{ secrets.AZ_PASSWORD }}" \
|
||||
--tenant "${{ secrets.AZ_TENANT_ID }}"
|
||||
|
||||
- name: Create AKS cluster
|
||||
run: |
|
||||
az aks create \
|
||||
-g "kataCI" \
|
||||
-n "${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64" \
|
||||
-s "Standard_D4s_v5" \
|
||||
--node-count 1 \
|
||||
--generate-ssh-keys
|
||||
|
||||
- name: Install `bats`
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install bats
|
||||
|
||||
- name: Install `kubectl`
|
||||
run: |
|
||||
sudo az aks install-cli
|
||||
|
||||
- name: Download credentials for the Kubernetes CLI to use them
|
||||
run: |
|
||||
az aks get-credentials -g "kataCI" -n ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64
|
||||
@ -73,8 +82,10 @@ jobs:
|
||||
env:
|
||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||
|
||||
- name: Delete AKS cluster used to test ${{ matrix.vmm }}
|
||||
if: always()
|
||||
uses: ./.github/workflows/delete-aks.yaml
|
||||
with:
|
||||
name: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64
|
||||
- name: Delete AKS cluster
|
||||
run: |
|
||||
az aks delete \
|
||||
-g "kataCI" \
|
||||
-n "${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64" \
|
||||
--yes \
|
||||
--no-wait
|
||||
|
Loading…
Reference in New Issue
Block a user