From 04ee9ee8e9b9d8bd5b377b54d1766f9407aa3490 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Tue, 10 Dec 2024 13:09:59 +1100 Subject: [PATCH 1/2] chore: support db vendor change --- Makefile | 3 +++ charts/lagoon-core/Chart.yaml | 15 +-------------- .../lagoon-core/templates/api-db.statefulset.yaml | 2 +- .../templates/keycloak-db.statefulset.yaml | 2 +- .../templates/keycloak.deployment.yaml | 4 +++- charts/lagoon-core/values.yaml | 4 +++- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index bd6a862cf..1c0fb28a4 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ OPENSEARCH_INTEGRATION_ENABLED = false CLEAR_API_DATA = false DOCKER_NETWORK = kind LAGOON_SSH_PORTAL_LOADBALANCER = +CORE_DATABASE_VENDOR = mariadb # install lagoon dependencies by default with the install-lagoon target INSTALL_LAGOON_DEPENDENCIES = true @@ -380,6 +381,7 @@ endif $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set actionsHandler.image.repository=$(IMAGE_REGISTRY)/actions-handler') \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set api.image.repository=$(IMAGE_REGISTRY)/api') \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set apiDB.image.repository=$(IMAGE_REGISTRY)/api-db') \ + --set apiDB.vendor=$(CORE_DATABASE_VENDOR) \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set apiRedis.image.repository=$(IMAGE_REGISTRY)/api-redis') \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set authServer.image.repository=$(IMAGE_REGISTRY)/auth-server') \ --set autoIdler.enabled=false \ @@ -392,6 +394,7 @@ endif --set insightsHandler.enabled=false \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set keycloak.image.repository=$(IMAGE_REGISTRY)/keycloak') \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set keycloakDB.image.repository=$(IMAGE_REGISTRY)/keycloak-db') \ + --set keycloakDB.vendor=$(CORE_DATABASE_VENDOR) \ $$([ $(IMAGE_REGISTRY) ] && [ $(INSTALL_STABLE_CORE) != true ] && echo '--set logs2notifications.image.repository=$(IMAGE_REGISTRY)/logs2notifications') \ $$([ $(INSTALL_MAILPIT) = true ] && echo '--set logs2notifications.additionalEnvs.EMAIL_HOST=mailpit-smtp.mailpit.svc') \ $$([ $(INSTALL_MAILPIT) = true ] && echo '--set logs2notifications.additionalEnvs.EMAIL_PORT="25"') \ diff --git a/charts/lagoon-core/Chart.yaml b/charts/lagoon-core/Chart.yaml index 8b15aeb6c..2a59489a7 100644 --- a/charts/lagoon-core/Chart.yaml +++ b/charts/lagoon-core/Chart.yaml @@ -41,17 +41,4 @@ dependencies: annotations: artifacthub.io/changes: | - kind: changed - description: update lagoon-core appVersion to v2.23.0 - links: - - name: Lagoon 2.23.0 release notes - url: https://docs.lagoon.sh/releases/2.23.0 - - kind: changed - description: add KEYCLOAK_ADMIN_API_CLIENT_SECRET variable to keycloak and api deployment - - kind: changed - description: update uselagoon/lagoon-ssh-portal/ssh-portal-api from v0.41.3 to v0.41.4 - - kind: changed - description: update uselagoon/lagoon-ssh-portal/ssh-token from v0.41.3 to v0.41.4 - - kind: changed - description: update uselagoon/lagoon-opensearch-sync from v0.8.0 to v0.8.1 - - kind: changed - description: update NATS chart dependency to 1.2.8 + description: initial support for changing the database vendor diff --git a/charts/lagoon-core/templates/api-db.statefulset.yaml b/charts/lagoon-core/templates/api-db.statefulset.yaml index 2b4979966..5d08e458f 100644 --- a/charts/lagoon-core/templates/api-db.statefulset.yaml +++ b/charts/lagoon-core/templates/api-db.statefulset.yaml @@ -34,7 +34,7 @@ spec: image: "{{ .Values.apiDB.image.repository }}:{{ coalesce .Values.apiDB.image.tag .Values.imageTag .Chart.AppVersion }}" imagePullPolicy: {{ .Values.apiDB.image.pullPolicy }} env: - - name: MARIADB_PASSWORD + - name: API_DB_PASSWORD valueFrom: secretKeyRef: name: {{ include "lagoon-core.apiDB.fullname" . }} diff --git a/charts/lagoon-core/templates/keycloak-db.statefulset.yaml b/charts/lagoon-core/templates/keycloak-db.statefulset.yaml index eedf93518..698ade5dd 100644 --- a/charts/lagoon-core/templates/keycloak-db.statefulset.yaml +++ b/charts/lagoon-core/templates/keycloak-db.statefulset.yaml @@ -34,7 +34,7 @@ spec: image: "{{ .Values.keycloakDB.image.repository }}:{{ coalesce .Values.keycloakDB.image.tag .Values.imageTag .Chart.AppVersion }}" imagePullPolicy: {{ .Values.keycloakDB.image.pullPolicy }} env: - - name: MARIADB_PASSWORD + - name: KEYCLOAK_DB_PASSWORD valueFrom: secretKeyRef: name: {{ include "lagoon-core.keycloak.fullname" . }} diff --git a/charts/lagoon-core/templates/keycloak.deployment.yaml b/charts/lagoon-core/templates/keycloak.deployment.yaml index 5392589e7..07bd9b247 100644 --- a/charts/lagoon-core/templates/keycloak.deployment.yaml +++ b/charts/lagoon-core/templates/keycloak.deployment.yaml @@ -53,10 +53,12 @@ spec: - name: KEYCLOAK_ADMIN_EMAIL value: {{ . | quote }} {{- end }} + - name: DB_VENDOR + value: {{ .Values.keycloakDB.vendor }} - name: LAGOON_DB_HOST value: {{ include "lagoon-core.apiDB.fullname" . }} - name: LAGOON_DB_VENDOR - value: mariadb + value: {{ .Values.apiDB.vendor }} - name: LAGOON_DB_USER value: api - name: LAGOON_DB_DATABASE diff --git a/charts/lagoon-core/values.yaml b/charts/lagoon-core/values.yaml index 23bb0fae7..bad2e6348 100644 --- a/charts/lagoon-core/values.yaml +++ b/charts/lagoon-core/values.yaml @@ -149,6 +149,7 @@ api: # targetMemoryUtilizationPercentage: 80 apiDB: + vendor: mariadb image: repository: uselagoon/api-db pullPolicy: Always @@ -186,7 +187,7 @@ apiDB: command: - test - -f - - /tmp/mariadb-init-complete + - /tmp/startup-init-complete livenessProbe: exec: @@ -291,6 +292,7 @@ keycloak: # - chart-example.local keycloakDB: + vendor: mariadb replicaCount: 1 image: repository: uselagoon/keycloak-db From d90a2878317297cbfaf60babb22824537443b42a Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Fri, 24 Jan 2025 11:18:59 +1100 Subject: [PATCH 2/2] chore: use supporting images --- .github/workflows/test-suite.yaml | 4 ++-- Makefile | 4 ++-- charts/lagoon-core/ci/testlagoon-main-override.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml index 97ae79862..110360bd0 100644 --- a/.github/workflows/test-suite.yaml +++ b/.github/workflows/test-suite.yaml @@ -143,8 +143,8 @@ jobs: (contains(github.event.pull_request.labels.*.name, 'next-release')) run: | yq eval-all --inplace 'select(fileIndex == 0) * select(fileIndex == 1)' ./charts/lagoon-core/ci/linter-values.yaml ./charts/lagoon-core/ci/testlagoon-main-override.yaml - make install-lagoon IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main - make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}] IMAGE_REGISTRY=testlagoon IMAGE_TAG=main OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main + make install-lagoon IMAGE_REGISTRY=testlagoon OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main + make -j8 -O fill-test-ci-values TESTS=[${{ matrix.test }}] IMAGE_REGISTRY=testlagoon OVERRIDE_BUILD_DEPLOY_DIND_IMAGE=uselagoon/build-deploy-image:main OVERRIDE_ACTIVE_STANDBY_TASK_IMAGE=testlagoon/task-activestandby:main - name: Free up some disk space if: | diff --git a/Makefile b/Makefile index 1c0fb28a4..9d38541ef 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,12 @@ TESTS = [api] # IMAGE_TAG controls the tag used for container images in the lagoon-core, # lagoon-remote, and lagoon-test charts. If IMAGE_TAG is not set, it will fall # back to the version set in the CI values file, then to the chart default. -IMAGE_TAG = +IMAGE_TAG = pr-3816 # IMAGE_REGISTRY controls the registry used for container images in the # lagoon-core, lagoon-remote, and lagoon-test charts. If IMAGE_REGISTRY is not # set, it will fall back to the version set in the chart values files. This # only affects lagoon-core, lagoon-remote, and the fill-test-ci-values target. -IMAGE_REGISTRY = uselagoon +IMAGE_REGISTRY = testlagoon # if OVERRIDE_BUILD_DEPLOY_DIND_IMAGE is not set, it will fall back to the # controller default (uselagoon/kubectl-build-deploy-dind:latest). OVERRIDE_BUILD_DEPLOY_DIND_IMAGE = diff --git a/charts/lagoon-core/ci/testlagoon-main-override.yaml b/charts/lagoon-core/ci/testlagoon-main-override.yaml index 802010051..cfe7f8013 100644 --- a/charts/lagoon-core/ci/testlagoon-main-override.yaml +++ b/charts/lagoon-core/ci/testlagoon-main-override.yaml @@ -1,4 +1,4 @@ -imageTag: "main" +imageTag: "pr-3816" api: image: