diff --git a/charts/geonode/templates/_helpers.tpl b/charts/geonode/templates/_helpers.tpl index ad26a9f..2515b0c 100644 --- a/charts/geonode/templates/_helpers.tpl +++ b/charts/geonode/templates/_helpers.tpl @@ -26,6 +26,7 @@ {{- end -}} + # Database definitions {{- define "database_hostname" -}} {{- if (index .Values "postgres-operator" "enabled") -}} @@ -76,6 +77,34 @@ {{- end -}} {{- end -}} +# define password key name in geonode postgres secret +{{- define "database_geonode_password_key_ref" -}} +{{- if (index .Values "postgres-operator" "enabled") -}} +password +{{- else if .Values.postgres.external_postgres.enabled -}} +geonode-password +{{- end -}} +{{- end -}} + +# define password key name in geodata postgres secret +{{- define "database_geodata_password_key_ref" -}} +{{- if (index .Values "postgres-operator" "enabled") -}} +password +{{- else if .Values.postgres.external_postgres.enabled -}} +geodata-password +{{- end -}} +{{- end -}} + +# define password key name in postgres postgres secret +{{- define "database_postgres_password_key_ref" -}} +{{- if (index .Values "postgres-operator" "enabled") -}} +password +{{- else if .Values.postgres.external_postgres.enabled -}} +postgres-password +{{- end -}} +{{- end -}} + + {{- define "pycsw_pod_name" -}} {{ .Release.Name }}-{{ .Values.pycsw.pod_name }} {{- end -}} @@ -102,4 +131,3 @@ amqp://{{ .Values.rabbitmq.auth.username }}:{{ .Values.rabbitmq.auth.password }} {{- define "boolean2str" -}} {{ . | ternary "True" "False" }} {{- end -}} - diff --git a/charts/geonode/templates/geonode/geonode-deploy.yaml b/charts/geonode/templates/geonode/geonode-deploy.yaml index 4be715a..b712bf8 100644 --- a/charts/geonode/templates/geonode/geonode-deploy.yaml +++ b/charts/geonode/templates/geonode/geonode-deploy.yaml @@ -212,17 +212,17 @@ spec: valueFrom: secretKeyRef: name: {{ include "database_geonode_password_secret_key_ref" . }} - key: password + key: {{ include "database_geonode_password_key_ref" . }} - name: GEONODE_GEODATABASE_PASSWORD valueFrom: secretKeyRef: name: {{ include "database_geodata_password_secret_key_ref" . }} - key: password + key: {{ include "database_geodata_password_key_ref" . }} - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: {{ include "database_postgres_password_secret_key_ref" . }} - key: password + key: {{ include "database_postgres_password_key_ref" . }} - name: GEODATABASE_URL value: "postgis://$(GEONODE_GEODATABASE):$(GEONODE_GEODATABASE_PASSWORD)@$(DATABASE_HOST):$(DATABASE_PORT)/$(GEONODE_GEODATABASE)" - name: DATABASE_URL diff --git a/charts/geonode/templates/geoserver/geoserver-deploy.yaml b/charts/geonode/templates/geoserver/geoserver-deploy.yaml index 2f00f7d..5864070 100644 --- a/charts/geonode/templates/geoserver/geoserver-deploy.yaml +++ b/charts/geonode/templates/geoserver/geoserver-deploy.yaml @@ -79,7 +79,7 @@ spec: valueFrom: secretKeyRef: name: {{ include "database_geodata_password_secret_key_ref" . }} - key: password + key: {{ include "database_geodata_password_key_ref" . }} volumeMounts: - name: "{{ include "persistant_volume_name" . }}" diff --git a/charts/geonode/templates/postgres/postgres-external-geodata-secrets.yaml b/charts/geonode/templates/postgres/postgres-external-geodata-secrets.yaml index cdd0a09..5df912c 100644 --- a/charts/geonode/templates/postgres/postgres-external-geodata-secrets.yaml +++ b/charts/geonode/templates/postgres/postgres-external-geodata-secrets.yaml @@ -6,6 +6,10 @@ metadata: namespace: {{ .Release.Namespace }} type: Opaque data: +<<<<<<< HEAD username: {{ .Values.postgres.geodata_databasename_and_username | b64enc }} password: {{ .Values.postgres.external_postgres.secret.geodata_password | b64enc }} +======= + geodata_password: {{ .Values.postgres.external_postgres.secret.geodata_password | b64enc }} +>>>>>>> c3d30d13231a852d96e84a856125ae9a22926b78 {{ end }} diff --git a/charts/geonode/templates/postgres/postgres-external-geonode-secrets.yaml b/charts/geonode/templates/postgres/postgres-external-geonode-secrets.yaml index e8a91ec..173c6ac 100644 --- a/charts/geonode/templates/postgres/postgres-external-geonode-secrets.yaml +++ b/charts/geonode/templates/postgres/postgres-external-geonode-secrets.yaml @@ -6,6 +6,10 @@ metadata: namespace: {{ .Release.Namespace }} type: Opaque data: +<<<<<<< HEAD username: {{ .Values.postgres.geonode_databasename_and_username | b64enc }} password: {{ .Values.postgres.external_postgres.secret.geonode_password | b64enc }} +======= + geonode_password: {{ .Values.postgres.external_postgres.secret.geonode_password | b64enc }} +>>>>>>> c3d30d13231a852d96e84a856125ae9a22926b78 {{ end }} diff --git a/charts/geonode/templates/postgres/postgres-external-postgres-secrets.yaml b/charts/geonode/templates/postgres/postgres-external-postgres-secrets.yaml index e1262e9..446ec7d 100644 --- a/charts/geonode/templates/postgres/postgres-external-postgres-secrets.yaml +++ b/charts/geonode/templates/postgres/postgres-external-postgres-secrets.yaml @@ -6,6 +6,5 @@ metadata: namespace: {{ .Release.Namespace }} type: Opaque data: - username: {{ .Values.postgres.username | b64enc }} - password: {{ .Values.postgres.external_postgres.secret.postgres_password | b64enc }} + postgres_password: {{ .Values.postgres.external_postgres.secret.postgres_password | b64enc }} {{ end }}