Skip to content
10 changes: 10 additions & 0 deletions deploy/manifests/balancer/base/database.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: Database
metadata:
name: balancer
namespace: cloudnative-pg
spec:
name: balancer
owner: balancer
cluster:
name: shared-cluster
10 changes: 10 additions & 0 deletions deploy/manifests/balancer/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ resources:
- deployment.yaml
- service.yaml
- ingress.yaml
- database.yaml

patches:
- target:
kind: Database
name: balancer
patch: |-
- op: replace
path: /metadata/namespace
value: cloudnative-pg
10 changes: 10 additions & 0 deletions deploy/manifests/balancer/overlays/sandbox/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: balancer-db-config
data:
SQL_HOST: shared-cluster-rw.cloudnative-pg.svc.cluster.local
SQL_PORT: "5432"
SQL_DATABASE: balancer
SQL_USER: balancer
SQL_ENGINE: django.db.backends.postgresql
27 changes: 27 additions & 0 deletions deploy/manifests/balancer/overlays/sandbox/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: balancer

resources:
- ../../base
- configmap.yaml

patches:
- target:
kind: Deployment
name: balancer
patch: |-
- op: add
path: /spec/template/spec/containers/0/envFrom/-
value:
configMapRef:
name: balancer-db-config
- op: add
path: /spec/template/spec/containers/0/env
value:
- name: SQL_PASSWORD
valueFrom:
secretKeyRef:
name: balancer-db-credentials
key: password
Loading