diff --git a/templates/beat/deployment.yaml b/templates/beat/deployment.yaml index 5d6cddd..dc422b8 100644 --- a/templates/beat/deployment.yaml +++ b/templates/beat/deployment.yaml @@ -48,9 +48,12 @@ spec: env: - name: SERVER_ROLE value: "beat" -{{- if .Values.env.secret.DATABASE_URL }} - - name: DATABASE_URL - value: {{ .Values.env.secret.DATABASE_URL }} +{{- if .Values.postgresql.enabled }} + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "django.postgresql.fullname" . }} + key: postgres-password {{- end }} envFrom: - secretRef: diff --git a/templates/web/deployment.yaml b/templates/web/deployment.yaml index 75664eb..eb6f45b 100644 --- a/templates/web/deployment.yaml +++ b/templates/web/deployment.yaml @@ -64,9 +64,12 @@ spec: valueFrom: fieldRef: fieldPath: status.podIP -{{- if .Values.env.secret.DATABASE_URL }} - - name: DATABASE_URL - value: {{ .Values.env.secret.DATABASE_URL }} +{{- if .Values.postgresql.enabled }} + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "django.postgresql.fullname" . }} + key: postgres-password {{- end }} envFrom: - secretRef: diff --git a/templates/web/pdb.yaml b/templates/web/pdb.yaml index 3e97a9b..3367e35 100644 --- a/templates/web/pdb.yaml +++ b/templates/web/pdb.yaml @@ -1,7 +1,7 @@ {{- if or (and .Values.web.autoscaling.enabled (gt (.Values.web.autoscaling.minReplicas | int) 1)) (gt (.Values.web.replicaCount | int) 1) }} {{- if .Values.web.budget -}} {{- if .Values.web.budget.minAvailable -}} -apiVersion: policy/v1beta1 +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "django.fullname" . }}-web diff --git a/templates/worker/deployment.yaml b/templates/worker/deployment.yaml index d427a67..6c7c269 100644 --- a/templates/worker/deployment.yaml +++ b/templates/worker/deployment.yaml @@ -42,9 +42,12 @@ spec: env: - name: SERVER_ROLE value: "worker" -{{- if .Values.env.secret.DATABASE_URL }} - - name: DATABASE_URL - value: {{ .Values.env.secret.DATABASE_URL }} +{{- if .Values.postgresql.enabled }} + - name: DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "django.postgresql.fullname" . }} + key: postgres-password {{- end }} envFrom: - secretRef: