diff --git a/charts/tasko-chart/templates/backend-deployment.yaml b/charts/tasko-chart/templates/backend-deployment.yaml index b738764..8e2071c 100644 --- a/charts/tasko-chart/templates/backend-deployment.yaml +++ b/charts/tasko-chart/templates/backend-deployment.yaml @@ -31,7 +31,7 @@ spec: initContainers: - name: wait-for-postgres image: busybox:1.35 - command: ['sh', '-c', 'until nc -z {{ include "tasko.fullname" . }}-postgresql 5432; do echo waiting for postgres; sleep 2; done;'] + command: ['sh', '-c', 'until nc -z {{ include "tasko.fullname" . }}-db-headless {{ .Values.postgres.port | default 5432 }}; do echo waiting for postgres; sleep 2; done;'] containers: - name: backend securityContext: diff --git a/charts/tasko-chart/templates/secret.yaml b/charts/tasko-chart/templates/secret.yaml index c72865d..5291fb8 100644 --- a/charts/tasko-chart/templates/secret.yaml +++ b/charts/tasko-chart/templates/secret.yaml @@ -6,4 +6,8 @@ metadata: {{- include "tasko.labels" . | nindent 4 }} type: Opaque stringData: + {{- if .Values.postgres }} + database-url: "postgresql://{{ .Values.postgres.user }}:{{ .Values.postgres.password }}@{{ include "tasko.fullname" . }}-db-headless:{{ .Values.postgres.port }}/{{ .Values.postgres.database }}" + {{- else if .Values.postgresql }} database-url: "postgresql://{{ .Values.postgresql.auth.username }}:{{ .Values.postgresql.auth.password }}@{{ include "tasko.fullname" . }}-postgresql:5432/{{ .Values.postgresql.auth.database }}" + {{- end }} diff --git a/manifests/tasko/values.yaml b/manifests/tasko/values.yaml index 68db062..64c7361 100644 --- a/manifests/tasko/values.yaml +++ b/manifests/tasko/values.yaml @@ -1,8 +1,5 @@ global: namespace: my-apps - imagePullSecrets: [] - -imagePullSecrets: [] # Backend configuration backend: @@ -93,8 +90,13 @@ postgres: password: tasko_password database: tasko_db port: 5432 + service: + type: ClusterIP + port: 5432 + targetPort: 5432 persistence: enabled: true + accessMode: ReadWriteOnce size: 8Gi storageClass: "" resources: @@ -104,3 +106,7 @@ postgres: limits: cpu: 500m memory: 512Mi + +# Use default ServiceAccount (has harbor-creds imagePullSecret) +serviceAccount: + create: false