Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support db vendor change #745

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-suite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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"') \
Expand Down
15 changes: 1 addition & 14 deletions charts/lagoon-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion charts/lagoon-core/ci/testlagoon-main-override.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
imageTag: "main"
imageTag: "pr-3816"

api:
image:
Expand Down
2 changes: 1 addition & 1 deletion charts/lagoon-core/templates/api-db.statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/lagoon-core/templates/keycloak-db.statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Expand Down
4 changes: 3 additions & 1 deletion charts/lagoon-core/templates/keycloak.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion charts/lagoon-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ api:
# targetMemoryUtilizationPercentage: 80

apiDB:
vendor: mariadb
image:
repository: uselagoon/api-db
pullPolicy: Always
Expand Down Expand Up @@ -186,7 +187,7 @@ apiDB:
command:
- test
- -f
- /tmp/mariadb-init-complete
- /tmp/startup-init-complete

livenessProbe:
exec:
Expand Down Expand Up @@ -291,6 +292,7 @@ keycloak:
# - chart-example.local

keycloakDB:
vendor: mariadb
replicaCount: 1
image:
repository: uselagoon/keycloak-db
Expand Down
Loading