Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion helm/pharos/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pharos
version: 0.0.1
description: Helm chart for pharos
appVersion: 0.0.1-testtesttesttesttesttesttesttesttesttesttesttesttest1234567890
appVersion: 0.0.1
dependencies:
- name: redis
alias: redis
Expand Down
30 changes: 30 additions & 0 deletions helm/pharos/templates/secret-postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if .Values.postgres.auth.generateSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.postgres.auth.existingSecret }}
labels:
{{- include "pharos.labels" . | nindent 4 }}
type: Opaque
data:
{{- /* Define $postgresPassword outside the if/else blocks so it's available throughout the template */ -}}
{{- $postgresPassword := "" }}
{{- $secret := (lookup "v1" "Secret" .Release.Namespace .Values.postgres.auth.existingSecret) }}
{{- if $secret }}
{{- $postgresPassword = index $secret.data "password" }}
{{- else }}
{{- $postgresPassword = randAlphaNum 16 }}
{{- end }}
{{- $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 }}
6 changes: 6 additions & 0 deletions helm/pharos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ postgres:
# -- Enable PostgreSQL deployment
enabled: true
# -- PostgreSQL authentication

passwordUpdateJob:
enabled: true

auth:
# -- Generate a secret for PostgreSQL connection
generateSecret: true
# -- Use an existing secret for PostgreSQL connection
existingSecret: "postgres-connection"
primary:
Expand Down
Loading