From 5d27b43be1da3f91d4830bea2a32cdccacb85dd4 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 14:52:07 +0200 Subject: [PATCH 01/11] Small fix --- .github/workflows/install-components-az.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/install-components-az.yml b/.github/workflows/install-components-az.yml index 9c1e847..a7b7961 100644 --- a/.github/workflows/install-components-az.yml +++ b/.github/workflows/install-components-az.yml @@ -88,7 +88,7 @@ jobs: run: | helm repo add stunner https://l7mp.io/stunner helm repo update - helm dependency . --skip-refresh + helm dependency build . --skip-refresh helm install stunner . --create-namespace --namespace=stunner - name: Install game operator manifests From 928b0b707c1a1b38424bc0453ff25c92d9cca9ad Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 14:52:29 +0200 Subject: [PATCH 02/11] Use develop as default image label --- .github/workflows/install-components-az.yml | 1 + .github/workflows/upgrade-components-az.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/install-components-az.yml b/.github/workflows/install-components-az.yml index a7b7961..e3debf0 100644 --- a/.github/workflows/install-components-az.yml +++ b/.github/workflows/install-components-az.yml @@ -20,6 +20,7 @@ on: label: type: string description: Image label to use + default: 'develop' env: REGISTRY: ghcr.io diff --git a/.github/workflows/upgrade-components-az.yml b/.github/workflows/upgrade-components-az.yml index 993a6ca..11a7a00 100644 --- a/.github/workflows/upgrade-components-az.yml +++ b/.github/workflows/upgrade-components-az.yml @@ -17,6 +17,7 @@ on: label: type: string description: Image label to use + default: 'develop' env: REGISTRY: ghcr.io From 585921671ba49ebb1dc41ba48316360fabf94ee5 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 14:58:02 +0200 Subject: [PATCH 03/11] Wait for MySQL to be uninstalled --- .github/workflows/uninstall-components-az.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uninstall-components-az.yml b/.github/workflows/uninstall-components-az.yml index c7d54c4..ffc3cf5 100644 --- a/.github/workflows/uninstall-components-az.yml +++ b/.github/workflows/uninstall-components-az.yml @@ -56,8 +56,8 @@ jobs: working-directory: ./helm/mysql if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'mysql')) }} run: | - helm uninstall mysql -n mysql - helm uninstall mysql-operator -n mysql-operator + helm uninstall mysql -n mysql --wait + helm uninstall mysql-operator -n mysql-operator --wait - name: Uninstall STUNner working-directory: ./helm/stunner From 86099e6005b2f6a76eb0815236a428e2beaf2dd4 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 15:07:21 +0200 Subject: [PATCH 04/11] Removing namespaces as well --- .github/workflows/uninstall-components-az.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/uninstall-components-az.yml b/.github/workflows/uninstall-components-az.yml index ffc3cf5..657409f 100644 --- a/.github/workflows/uninstall-components-az.yml +++ b/.github/workflows/uninstall-components-az.yml @@ -58,11 +58,15 @@ jobs: run: | helm uninstall mysql -n mysql --wait helm uninstall mysql-operator -n mysql-operator --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 + run: | + helm uninstall stunner -n stunner --wait + kubectl delete ns stunner - name: Uninstall game operator manifests working-directory: ./operator @@ -86,7 +90,9 @@ jobs: - name: Uninstall Grafana if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'grafana')) }} - run: helm uninstall grafana -n monitoring + run: | + helm uninstall grafana -n monitoring --wait + kubectl delete ns monitoring - name: Logout of Azure if: always() From 81da4b4dcccb3d20c533b221785b14a410657ce9 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 15:22:41 +0200 Subject: [PATCH 05/11] Small fix --- .github/workflows/install-components-az.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install-components-az.yml b/.github/workflows/install-components-az.yml index e3debf0..1ed70e9 100644 --- a/.github/workflows/install-components-az.yml +++ b/.github/workflows/install-components-az.yml @@ -149,7 +149,7 @@ jobs: - name: Wait for external IP of API if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend') }} run: | - until [ -n "$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].ip}')" ]; do + until [ -n "$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')" ]; do sleep 5 done @@ -158,7 +158,7 @@ jobs: if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend') }} run: | helm install -f values.yaml \ - --set-string appConfig.apiUrl=http://$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].ip}'):$(kubectl get svc api -n api -o jsonpath='{.spec.ports[0].port}') \ + --set-string appConfig.apiUrl=http://$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'):$(kubectl get svc api -n api -o jsonpath='{.spec.ports[0].port}') \ --set-string image.label=${{ github.event.inputs.label }} \ frontend . From 2f959e8a1577d1e5ba98b0272ec50f94b58a1137 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 15:31:28 +0200 Subject: [PATCH 06/11] Removed required --- helm/frontend/templates/frontend-configmap.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/helm/frontend/templates/frontend-configmap.yaml b/helm/frontend/templates/frontend-configmap.yaml index 0113bde..56f95b4 100644 --- a/helm/frontend/templates/frontend-configmap.yaml +++ b/helm/frontend/templates/frontend-configmap.yaml @@ -1,5 +1,3 @@ -{{- required ".Values.appConfig.production is required!" .Values.appConfig.production -}} -{{- required ".Values.appConfig.apiUrl is required!" .Values.appConfig.apiUrl -}} apiVersion: v1 kind: ConfigMap metadata: From fe639bc3d3875bbf2a21329232fd1a47e142ede0 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 15:38:19 +0200 Subject: [PATCH 07/11] Remove make uninstall from uninstall workflow --- .github/workflows/uninstall-components-az.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/uninstall-components-az.yml b/.github/workflows/uninstall-components-az.yml index 657409f..de8f490 100644 --- a/.github/workflows/uninstall-components-az.yml +++ b/.github/workflows/uninstall-components-az.yml @@ -68,10 +68,10 @@ jobs: helm uninstall stunner -n stunner --wait kubectl delete ns stunner - - name: Uninstall game operator manifests - working-directory: ./operator - if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator')) }} - run: make uninstall + #- name: Uninstall game operator manifests + # working-directory: ./operator + # if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator')) }} + # run: make uninstall - name: Undeploy game operator working-directory: ./operator From a0c50963bb636674dc48ee4d11d9bb067c4db2c3 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 16:05:45 +0200 Subject: [PATCH 08/11] Ignoring helm releases that are already uninstalled --- .github/workflows/uninstall-components-az.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/uninstall-components-az.yml b/.github/workflows/uninstall-components-az.yml index de8f490..1f6b25a 100644 --- a/.github/workflows/uninstall-components-az.yml +++ b/.github/workflows/uninstall-components-az.yml @@ -56,8 +56,8 @@ jobs: working-directory: ./helm/mysql if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'mysql')) }} run: | - helm uninstall mysql -n mysql --wait - helm uninstall mysql-operator -n mysql-operator --wait + 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 @@ -65,7 +65,7 @@ jobs: working-directory: ./helm/stunner if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'stunner')) }} run: | - helm uninstall stunner -n stunner --wait + helm uninstall stunner -n stunner --ignore-not-found --wait kubectl delete ns stunner #- name: Uninstall game operator manifests @@ -91,7 +91,7 @@ jobs: - name: Uninstall Grafana if: ${{ !cancelled() && (github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'grafana')) }} run: | - helm uninstall grafana -n monitoring --wait + helm uninstall grafana -n monitoring --ignore-not-found --wait kubectl delete ns monitoring - name: Logout of Azure From b13688b80a2c26adacbf91e3c8dedf6b68b8d995 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 16:41:14 +0200 Subject: [PATCH 09/11] Small fix --- .github/workflows/upgrade-components-az.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upgrade-components-az.yml b/.github/workflows/upgrade-components-az.yml index 11a7a00..c0f5000 100644 --- a/.github/workflows/upgrade-components-az.yml +++ b/.github/workflows/upgrade-components-az.yml @@ -110,7 +110,7 @@ jobs: - name: Wait for external IP of API if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend') }} run: | - until [ -n "$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].ip}')" ]; do + until [ -n "$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')" ]; do sleep 5 done @@ -119,7 +119,7 @@ jobs: if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend') }} run: | helm upgrade -f values.yaml \ - --set-string appConfig.apiUrl=http://$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].ip}'):$(kubectl get svc api -n api -o jsonpath='{.spec.ports[0].port}') \ + --set-string appConfig.apiUrl=http://$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'):$(kubectl get svc api -n api -o jsonpath='{.spec.ports[0].port}') \ --set-string image.label=${{ github.event.inputs.label }} \ frontend . From b09ae68484a05be008508eec8dff8f1b762ca195 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 16:42:28 +0200 Subject: [PATCH 10/11] Small fix --- .github/workflows/upgrade-components-az.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/upgrade-components-az.yml b/.github/workflows/upgrade-components-az.yml index c0f5000..66ff04c 100644 --- a/.github/workflows/upgrade-components-az.yml +++ b/.github/workflows/upgrade-components-az.yml @@ -57,6 +57,11 @@ jobs: - name: Configure kubernetes config run: tailscale configure kubeconfig tailscale-operator + - name: Undeploy game operator + working-directory: ./operator + if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator') }} + run: make undeploy + - name: Install game operator manifests working-directory: ./operator if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator') }} @@ -67,11 +72,6 @@ jobs: if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator') }} run: make deploy IMG=${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.SUB_NAMESPACE }}/operator:${{ github.event.inputs.label }} - - name: Undeploy game operator - working-directory: ./operator - if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'operator') }} - run: make undeploy - - name: Wait for MySQL to be ready if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'api') }} run: | From 34303feea9f0b5861262d0c2130a164a59dfa9a1 Mon Sep 17 00:00:00 2001 From: Thomas Riegler Date: Sun, 16 Jun 2024 16:47:23 +0200 Subject: [PATCH 11/11] Reusing values --- .github/workflows/upgrade-components-az.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/upgrade-components-az.yml b/.github/workflows/upgrade-components-az.yml index 66ff04c..4bb7786 100644 --- a/.github/workflows/upgrade-components-az.yml +++ b/.github/workflows/upgrade-components-az.yml @@ -103,7 +103,7 @@ jobs: working-directory: ./helm/api if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'api') }} run: | - helm upgrade -f values.yaml \ + helm upgrade --reuse-values \ --set-string image.label=${{ github.event.inputs.label }} \ api . @@ -118,7 +118,7 @@ jobs: working-directory: ./helm/frontend if: ${{ github.event.inputs.component == 'all' || contains(github.event.inputs.component, 'frontend') }} run: | - helm upgrade -f values.yaml \ + helm upgrade --reuse-values \ --set-string appConfig.apiUrl=http://$(kubectl get svc api -n api -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'):$(kubectl get svc api -n api -o jsonpath='{.spec.ports[0].port}') \ --set-string image.label=${{ github.event.inputs.label }} \ frontend .