diff --git a/components/hydra-cnpg-database/patches/hydra-deployment.yaml b/components/hydra-cnpg-database/patches/hydra-deployment.yaml index 54fdd1b..de66515 100644 --- a/components/hydra-cnpg-database/patches/hydra-deployment.yaml +++ b/components/hydra-cnpg-database/patches/hydra-deployment.yaml @@ -18,9 +18,12 @@ path: "/spec/template/spec/containers/0/env/-" value: name: HYDRA_DATABASE_SERVICE_NAME - value: hydra-postgres-pooler-rw + 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):5432/hydra?sslmode=disable" + value: "postgres://$(HYDRA_DATABASE_USER):$(HYDRA_DATABASE_PASSWORD)@$(HYDRA_DATABASE_SERVICE_NAME):5432/hydra?sslmode=disable&max_conn=$(HYDRA_DATABASE_MAX_CONN)" diff --git a/components/hydra-cnpg-database/resources/hydra-postgres-pooler-rw.yaml b/components/hydra-cnpg-database/resources/hydra-postgres-pooler-rw.yaml deleted file mode 100644 index 45fa942..0000000 --- a/components/hydra-cnpg-database/resources/hydra-postgres-pooler-rw.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: postgresql.cnpg.io/v1 -kind: Pooler -metadata: - name: hydra-postgres-pooler-rw -spec: - cluster: - name: hydra-postgres - instances: 3 - type: rw - pgbouncer: - poolMode: session - parameters: - max_client_conn: "1000" - default_pool_size: "50" diff --git a/resources/hydra/kustomization.yaml b/resources/hydra/kustomization.yaml index f99e668..c4e4615 100644 --- a/resources/hydra/kustomization.yaml +++ b/resources/hydra/kustomization.yaml @@ -30,6 +30,7 @@ configMapGenerator: - URLS_CONSENT=http://hydra-consent-app/consent - URLS_LOGOUT=http://hydra-logout-app/logout - HYDRA_SERVE_ALL_ARGS=--dev + - HYDRA_DATABASE_MAX_CONN="10" - LOG_LEVEL=info vars: