58 lines
1.2 KiB
YAML
58 lines
1.2 KiB
YAML
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: databases
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: pgbouncer
|
|
namespace: databases
|
|
spec:
|
|
serviceName: "pgbouncer"
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: pgbouncer
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: pgbouncer
|
|
spec:
|
|
containers:
|
|
- name: pgbouncer
|
|
image: bitnami/pgbouncer:latest
|
|
ports:
|
|
- containerPort: 5432
|
|
env:
|
|
- name: POSTGRESQL_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: secrets
|
|
key: POSTGRES_PASSWORD
|
|
- name: PGBOUNCER_PORT
|
|
value: "5432"
|
|
- name: PGBOUNCER_USER
|
|
value: "postgres"
|
|
- name: PGBOUNCER_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: secrets
|
|
key: POSTGRES_PASSWORD
|
|
- name: POSTGRESQL_HOST
|
|
value: postgres.databases
|
|
- name: PGBOUNCER_DATABASE
|
|
value: nocodelytics_production
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: pgbouncer
|
|
namespace: databases
|
|
spec:
|
|
ports:
|
|
- port: 5432
|
|
targetPort: 5432
|
|
selector:
|
|
app: pgbouncer
|