Uninstalling component 'frontend' from AKS cluster #29
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
name: Uninstall components from Azure | |
run-name: Uninstalling component '${{ github.event.inputs.component }}' from AKS cluster | |
on: | |
workflow_dispatch: | |
inputs: | |
component: | |
type: choice | |
description: Which component | |
required: true | |
options: | |
- frontend | |
- api | |
- api-mysql | |
- operator | |
- operator-stunner | |
- stunner | |
- mysql | |
- grafana | |
- all | |
jobs: | |
uninstall: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Helm | |
uses: azure/[email protected] | |
with: | |
version: 'latest' | |
id: install1 | |
- name: Install kubectl | |
uses: azure/setup-kubectl@v3 | |
with: | |
version: 'latest' | |
id: install2 | |
- name: Login to Azure | |
run: az login --service-principal -u ${{ secrets.CLIENT_ID }} -p ${{ secrets.CLIENT_SECRET }} --tenant ${{ secrets.AZURERM_TENANT_ID }} | |
- name: Connect to tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{secrets.TAILSCALE_CLIENT_ID_2}} | |
oauth-secret: ${{secrets.TAILSCALE_CLIENT_SECRET_2}} | |
tags: tag:ci | |
- name: Configure kubernetes config | |
run: tailscale configure kubeconfig tailscale-operator-1 | |
- name: Uninstall MySQL | |
working-directory: ./helm/mysql | |
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'mysql')) }} | |
run: | | |
helm uninstall mysql -n mysql --ignore-not-found --wait | |
helm uninstall mysql-operator -n mysql-operator --ignore-not-found --wait | |
kubectl delete ns mysql | |
kubectl delete ns mysql-operator | |
- name: Uninstall STUNner | |
working-directory: ./helm/stunner | |
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'stunner')) }} | |
run: | | |
helm uninstall stunner -n stunner --ignore-not-found --wait | |
kubectl delete ns stunner | |
- name: Undeploy game operator | |
working-directory: ./operator | |
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator')) }} | |
run: make undeploy | |
- name: Uninstall API | |
working-directory: ./helm/api | |
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'api')) }} | |
run: helm uninstall api | |
- name: Uninstall frontend | |
working-directory: ./helm/frontend | |
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend')) }} | |
run: helm uninstall frontend | |
- name: Uninstall Grafana | |
if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'grafana')) }} | |
run: | | |
helm uninstall grafana -n monitoring --ignore-not-found --wait | |
kubectl delete ns monitoring | |
- name: Logout of Azure | |
if: always() | |
run: az logout |