First-Try

This commit is contained in:
Philippe Caseiro 2024-09-26 09:50:54 +02:00
parent a5cecb385c
commit f850a56562
3 changed files with 34 additions and 26 deletions

View File

@ -6,28 +6,28 @@ configurations:
resources:
- ./resources/hydra-cnpg-cluster.yaml
- ./resources/hydra-postgres-pooler-rw.yaml
secretGenerator:
- name: hydra-postgres-admin
type: Secret
literals:
- username=postgres
- password=NotSoSecret
- name: hydra-postgres-user
type: Secret
literals:
- username=hydra
- password=NotSoSecret
#secretGenerator:
#- name: hydra-postgres-admin
# type: Secret
# literals:
# - username=postgres
# - password=NotSoSecret
#- name: hydra-postgres-user
# type: Secret
# literals:
# - username=hydra
# - password=NotSoSecret
vars:
- name: HYDRA_DATABASE_SERVICE_NAME
objref:
name: hydra-postgres
kind: Cluster
apiVersion: postgresql.cnpg.io/v1
fieldref:
fieldpath: metadata.name
#vars:
#- name: HYDRA_DATABASE_SERVICE_NAME
# objref:
# name: hydra-postgres
# kind: Cluster
# apiVersion: postgresql.cnpg.io/v1
# fieldref:
# fieldpath: metadata.name
patches:
- target:

View File

@ -4,7 +4,7 @@
name: HYDRA_DATABASE_USER
valueFrom:
secretKeyRef:
name: hydra-postgres-user
name: hydra-postgres-app
key: username
- op: add
path: "/spec/template/spec/containers/0/env/-"
@ -12,10 +12,18 @@
name: HYDRA_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: hydra-postgres-user
name: hydra-postgres-app
key: password
- op: add
path: "/spec/template/spec/containers/0/env/-"
value:
name: HYDRA_DATABASE_SERVICE_NAME
valueFrom:
secretKeyRef:
name: hydra-postgres-app
key: host
- op: add
path: "/spec/template/spec/containers/0/env/-"
value:
name: DSN
value: "postgres://$(HYDRA_DATABASE_USER):$(HYDRA_DATABASE_PASSWORD)@$(HYDRA_DATABASE_SERVICE_NAME)-rw:5432/hydra?sslmode=disable"
value: "postgres://$(HYDRA_DATABASE_USER):$(HYDRA_DATABASE_PASSWORD)@$(HYDRA_DATABASE_SERVICE_NAME)-rw:5432/hydra?sslmode=disable"

View File

@ -11,7 +11,7 @@ spec:
initdb:
database: hydra
owner: hydra
secret:
name: hydra-postgres-user
#secret:
# name: hydra-postgres-user
storage:
size: 2Gi
size: 2Gi