From 91515a32c53b794d4b739bb56487c7b914650ad9 Mon Sep 17 00:00:00 2001 From: Curtis Ruck Date: Tue, 12 Jul 2022 14:54:14 -0400 Subject: [PATCH] add jdbc-init container --- charts/guacamole-client/Chart.yaml | 4 +- .../templates/deployment.yaml | 41 +++++++++++++++++++ charts/guacamole-client/values.yaml | 9 ++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/charts/guacamole-client/Chart.yaml b/charts/guacamole-client/Chart.yaml index 310cb9e..12e845f 100644 --- a/charts/guacamole-client/Chart.yaml +++ b/charts/guacamole-client/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.5 +version: 0.1.6 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.4.0-5" +appVersion: "1.4.0-6" diff --git a/charts/guacamole-client/templates/deployment.yaml b/charts/guacamole-client/templates/deployment.yaml index e1b9360..b9e3856 100644 --- a/charts/guacamole-client/templates/deployment.yaml +++ b/charts/guacamole-client/templates/deployment.yaml @@ -27,6 +27,31 @@ spec: serviceAccountName: {{ include "guacamole-client.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + env: + - name: PGHOST + value: {{ .Values.database.hostname }} + - name: PGPORT + value: {{ .Values.database.port | default "5432" }} + - name: PGDATABASE + value: {{ .Values.database.name }} + - name: PGUSER + valueFrom: + secretKeyRef: + name: {{ .Values.database.username.secret }} + key: username + - name: PGPASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.database.password.secret }} + key: password containers: - name: {{ .Chart.Name }} securityContext: @@ -40,6 +65,22 @@ spec: resources: {{- toYaml .Values.resources | nindent 12 }} env: + - name: POSTGRESQL_HOSTNAME + value: {{ .Values.database.hostname }} + - name: POSTGRESQL_PORT + value: {{ .Values.database.port | default "5432" }} + - name: POSTGRESQL_DATABASE + value: {{ .Values.database.name }} + - name: POSTGRESQL_USERNAME + valueFrom: + secretKeyRef: + name: {{ .Values.database.username.secret }} + key: username + - name: POSTGRESQL_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Values.database.password.secret }} + key: password {{- toYaml .Values.configEnv | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/guacamole-client/values.yaml b/charts/guacamole-client/values.yaml index 28bc061..4760683 100644 --- a/charts/guacamole-client/values.yaml +++ b/charts/guacamole-client/values.yaml @@ -80,3 +80,12 @@ nodeSelector: {} tolerations: [] affinity: {} + +database: + host: localhost + port: 5432 + name: guacamole + username: + secret: database-credentials + password: + secret: database-credentials