diff --git a/argocd/pgbouncer-app.yaml b/argocd/pgbouncer-app.yaml new file mode 100644 index 0000000..99adf16 --- /dev/null +++ b/argocd/pgbouncer-app.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: pgbouncer + namespace: argocd +spec: + project: default + source: + repoURL: ssh://git@git-ssh.lunarfront.tech/ryan/lunarfront-charts.git + targetRevision: main + path: pgbouncer + destination: + server: https://kubernetes.default.svc + namespace: pgbouncer + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/pgbouncer/configmap.yaml b/pgbouncer/configmap.yaml new file mode 100644 index 0000000..0d72578 --- /dev/null +++ b/pgbouncer/configmap.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: pgbouncer-config + namespace: pgbouncer +data: + pgbouncer.ini: | + [databases] + gitea = host=lunarfront-postgres-do-user-35277853-0.e.db.ondigitalocean.com port=25060 dbname=gitea user=gitea + windmill = host=lunarfront-postgres-do-user-35277853-0.e.db.ondigitalocean.com port=25060 dbname=windmill user=windmill + + [pgbouncer] + listen_port = 5432 + listen_addr = 0.0.0.0 + auth_type = plain + auth_file = /etc/pgbouncer/userlist.txt + pool_mode = transaction + max_client_conn = 200 + default_pool_size = 5 + min_pool_size = 1 + reserve_pool_size = 2 + server_tls_sslmode = require + ignore_startup_parameters = extra_float_digits + log_connections = 0 + log_disconnections = 0 diff --git a/pgbouncer/deployment.yaml b/pgbouncer/deployment.yaml new file mode 100644 index 0000000..7dedc66 --- /dev/null +++ b/pgbouncer/deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pgbouncer + namespace: pgbouncer +spec: + replicas: 1 + selector: + matchLabels: + app: pgbouncer + template: + metadata: + labels: + app: pgbouncer + spec: + containers: + - name: pgbouncer + image: pgbouncer/pgbouncer:1.23.1 + ports: + - containerPort: 5432 + volumeMounts: + - name: config + mountPath: /etc/pgbouncer/pgbouncer.ini + subPath: pgbouncer.ini + - name: userlist + mountPath: /etc/pgbouncer/userlist.txt + subPath: userlist.txt + resources: + requests: + cpu: 10m + memory: 32Mi + limits: + cpu: 200m + memory: 64Mi + livenessProbe: + tcpSocket: + port: 5432 + initialDelaySeconds: 10 + periodSeconds: 30 + readinessProbe: + tcpSocket: + port: 5432 + initialDelaySeconds: 5 + periodSeconds: 10 + volumes: + - name: config + configMap: + name: pgbouncer-config + - name: userlist + secret: + secretName: pgbouncer-userlist diff --git a/pgbouncer/service.yaml b/pgbouncer/service.yaml new file mode 100644 index 0000000..4852bd8 --- /dev/null +++ b/pgbouncer/service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: pgbouncer + namespace: pgbouncer +spec: + selector: + app: pgbouncer + ports: + - port: 5432 + targetPort: 5432