From e2f2094cf5fb668b1822d93c936da350ba7781e6 Mon Sep 17 00:00:00 2001 From: shreddedbacon Date: Tue, 14 Jan 2025 10:14:27 +1100 Subject: [PATCH] chore: move harbor credential into secret --- charts/lagoon-build-deploy/Chart.yaml | 4 ++-- .../lagoon-build-deploy/templates/deployment.yaml | 14 ++++++++++++-- charts/lagoon-build-deploy/templates/secret.yaml | 4 ++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/charts/lagoon-build-deploy/Chart.yaml b/charts/lagoon-build-deploy/Chart.yaml index 63d08fd09..6446d4a69 100644 --- a/charts/lagoon-build-deploy/Chart.yaml +++ b/charts/lagoon-build-deploy/Chart.yaml @@ -16,14 +16,14 @@ kubeVersion: ">= 1.25.0-0" type: application -version: 0.31.1 +version: 0.32.0 appVersion: v0.21.0 annotations: artifacthub.io/changes: | - kind: changed - description: fix servicemonitor for lagoon build metrics + description: move harbor credentials into secret artifacthub.io/crds: | - kind: LagoonBuild version: v1beta2 diff --git a/charts/lagoon-build-deploy/templates/deployment.yaml b/charts/lagoon-build-deploy/templates/deployment.yaml index 117b80303..c504c85c5 100644 --- a/charts/lagoon-build-deploy/templates/deployment.yaml +++ b/charts/lagoon-build-deploy/templates/deployment.yaml @@ -40,8 +40,6 @@ spec: - "--leader-elect=true" {{- if .Values.harbor.enabled }} - "--enable-harbor=true" - - "--harbor-password={{ .Values.harbor.adminPassword }}" - - "--harbor-username={{ .Values.harbor.adminUser }}" - "--harbor-url={{ .Values.harbor.host }}" - "--harbor-api={{ .Values.harbor.host }}/api" {{- if .Values.harbor.rotationCron }} @@ -253,6 +251,18 @@ spec: secretKeyRef: name: {{ include "lagoon-build-deploy.fullname" . }} key: RABBITMQ_USERNAME + {{- if .Values.harbor.enabled }} + - name: HARBOR_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "lagoon-build-deploy.fullname" . }} + key: HARBOR_PASSWORD + - name: HARBOR_USERNAME + valueFrom: + secretKeyRef: + name: {{ include "lagoon-build-deploy.fullname" . }} + key: HARBOR_USERNAME + {{- end }} - name: NAMESPACE_PREFIX value: {{ .Values.namespacePrefix | quote }} - name: CONTROLLER_NAMESPACE diff --git a/charts/lagoon-build-deploy/templates/secret.yaml b/charts/lagoon-build-deploy/templates/secret.yaml index b1b2c5022..414ce0d08 100644 --- a/charts/lagoon-build-deploy/templates/secret.yaml +++ b/charts/lagoon-build-deploy/templates/secret.yaml @@ -11,3 +11,7 @@ metadata: stringData: RABBITMQ_PASSWORD: {{ required "A valid rabbitMQPassword required!" $rabbitMQPassword | quote }} RABBITMQ_USERNAME: {{ required "A valid rabbitMQUsername required!" $rabbitMQUsername | quote }} +{{- if .Values.harbor.enabled }} + HARBOR_PASSWORD: {{ .Values.harbor.adminPassword | quote }} + HARBOR_USERNAME: {{ .Values.harbor.adminUser | quote }} +{{- end }}