mirror of
https://github.com/GothenburgBitFactory/taskchampion-sync-server.git
synced 2026-07-16 00:14:44 +00:00
Simplifying secret management
This commit is contained in:
committed by
Dustin J. Mitchell
parent
c58bb4800d
commit
84c06475c6
@ -43,18 +43,17 @@ Reference it via `clientIdSecret: "my-client-ids"`.
|
||||
|
||||
### PostgreSQL Secret
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: my-postgres-creds
|
||||
type: Opaque
|
||||
data:
|
||||
connection: <base64-encoded LibPQ connection URI>
|
||||
password: <base64-encoded password>
|
||||
```
|
||||
For PostgreSQL, the chart can automatically create a secret with the connection string, or use an existing secret.
|
||||
|
||||
Reference it via `postgres.existingSecret: "my-postgres-creds"`.
|
||||
**Automatic Secret Creation**:
|
||||
- When `postgres.existingSecret` is empty (default), the chart automatically creates a secret
|
||||
- Secret is named using Helm naming convention: `release-name-taskchampion-sync-server`
|
||||
- Secret contains only a `connection` key with the built connection string
|
||||
|
||||
**Existing Secret Usage**:
|
||||
- When `postgres.existingSecret` is provided, the chart uses that secret
|
||||
- The secret **must** contain a `connection` key with the PostgreSQL connection string
|
||||
- If the secret doesn't have a `connection` key, the deployment will fail with a clear error
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
@ -3,7 +3,6 @@ sqlite:
|
||||
|
||||
postgres:
|
||||
enabled: true
|
||||
existingSecret: "taskchampion-postgres-creds"
|
||||
database: taskchampion
|
||||
host: postgres-primary
|
||||
username: taskchampion-user
|
||||
|
||||
@ -67,9 +67,5 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "taskchampion-sync-server.postgres-secret-name" -}}
|
||||
{{- if .Values.postgres.existingSecret -}}
|
||||
{{- .Values.postgres.existingSecret -}}
|
||||
{{- else -}}
|
||||
{{- include "taskchampion-sync-server.fullname" . -}}
|
||||
{{- end }}
|
||||
{{- printf "%s-connection" .Release.Name -}}
|
||||
{{- end -}}
|
||||
@ -1,11 +1,11 @@
|
||||
{{- if and .Values.postgres.enabled (eq .Values.postgres.existingSecret "") -}}
|
||||
{{- if .Values.postgres.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "taskchampion-sync-server.fullname" . }}
|
||||
name: {{ include "taskchampion-sync-server.postgres-secret-name" . }}
|
||||
labels:
|
||||
{{- include "taskchampion-sync-server.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
connection: {{ include "taskchampion-sync-server.postgres-connection" . | b64enc }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user