Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- main
- PH-52/*
- 85-*
- PH-47/*
- PH-54/*
- PH-79/*
Expand Down
23 changes: 23 additions & 0 deletions helm/pharos/templates/secret-postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if and .Values.postgresql.enabled .Values.postgresql.auth.generateSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.postgresql.auth.existingSecret }}
labels:
{{- include "pharos.labels" . | nindent 4 }}
type: Opaque
data:
{{- $postgresPassword := randAlphaNum 16 }}
{{- $postgresUsername := "pharos" }}
{{- $postgresPort := "5432" }}
{{- $postgresEndpoint := printf "%s-postgres.%s.svc.cluster.local" .Release.Name .Release.Namespace }}
{{- $postgresDSN := printf "postgres://%s:%s@%s:%s/%s?sslmode=disable" $postgresUsername $postgresPassword $postgresEndpoint $postgresPort $postgresUsername }}

# Store the generated values
postgres-password: {{ $postgresPassword | b64enc }}
password: {{ $postgresPassword | b64enc }}
username: {{ $postgresUsername | b64enc }}
port: {{ $postgresPort | b64enc }}
endpoint: {{ $postgresEndpoint | b64enc }}
dsn: {{ $postgresDSN | b64enc }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/pharos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ postgres:
enabled: true
# -- PostgreSQL authentication
auth:
# -- Generate a secret for PostgreSQL connection
generateSecret: true
# -- Use an existing secret for PostgreSQL connection
existingSecret: "postgres-connection"
primary:
Expand Down
Loading