140 lines
4.8 KiB
YAML
140 lines
4.8 KiB
YAML
# Source: gitea/charts/postgresql-ha/templates/pgpool/deployment.yaml
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: gitea-postgresql-ha-pgpool
|
|
namespace: "vynil-ci"
|
|
labels:
|
|
app.kubernetes.io/instance: gitea
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: postgresql-ha
|
|
helm.sh/chart: postgresql-ha-11.9.4
|
|
app.kubernetes.io/component: pgpool
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: gitea
|
|
app.kubernetes.io/name: postgresql-ha
|
|
app.kubernetes.io/component: pgpool
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/instance: gitea
|
|
app.kubernetes.io/managed-by: Helm
|
|
app.kubernetes.io/name: postgresql-ha
|
|
helm.sh/chart: postgresql-ha-11.9.4
|
|
app.kubernetes.io/component: pgpool
|
|
spec:
|
|
|
|
affinity:
|
|
podAffinity:
|
|
|
|
podAntiAffinity:
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
- podAffinityTerm:
|
|
labelSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: gitea
|
|
app.kubernetes.io/name: postgresql-ha
|
|
app.kubernetes.io/component: pgpool
|
|
topologyKey: kubernetes.io/hostname
|
|
weight: 1
|
|
nodeAffinity:
|
|
|
|
securityContext:
|
|
fsGroup: 1001
|
|
# Auxiliary vars to populate environment variables
|
|
containers:
|
|
- name: pgpool
|
|
image: docker.io/bitnami/pgpool:4.4.4-debian-11-r24
|
|
imagePullPolicy: "IfNotPresent"
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop:
|
|
- ALL
|
|
readOnlyRootFilesystem: false
|
|
runAsGroup: 0
|
|
runAsNonRoot: true
|
|
runAsUser: 1001
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
env:
|
|
- name: BITNAMI_DEBUG
|
|
value: "false"
|
|
- name: PGPOOL_BACKEND_NODES
|
|
value: 0:gitea-postgresql-ha-postgresql-0.gitea-postgresql-ha-postgresql-headless:5432,1:gitea-postgresql-ha-postgresql-1.gitea-postgresql-ha-postgresql-headless:5432,2:gitea-postgresql-ha-postgresql-2.gitea-postgresql-ha-postgresql-headless:5432,
|
|
- name: PGPOOL_SR_CHECK_USER
|
|
value: "repmgr"
|
|
- name: PGPOOL_SR_CHECK_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: gitea-postgresql-ha-postgresql
|
|
key: repmgr-password
|
|
- name: PGPOOL_SR_CHECK_DATABASE
|
|
value: "postgres"
|
|
- name: PGPOOL_ENABLE_LDAP
|
|
value: "no"
|
|
- name: PGPOOL_POSTGRES_USERNAME
|
|
value: "gitea"
|
|
- name: PGPOOL_POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: gitea-postgresql-ha-postgresql
|
|
key: password
|
|
- name: PGPOOL_ADMIN_USERNAME
|
|
value: "admin"
|
|
- name: PGPOOL_ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: gitea-postgresql-ha-pgpool
|
|
key: admin-password
|
|
- name: PGPOOL_AUTHENTICATION_METHOD
|
|
value: "scram-sha-256"
|
|
- name: PGPOOL_ENABLE_LOAD_BALANCING
|
|
value: "yes"
|
|
- name: PGPOOL_DISABLE_LOAD_BALANCE_ON_WRITE
|
|
value: "transaction"
|
|
- name: PGPOOL_ENABLE_LOG_CONNECTIONS
|
|
value: "no"
|
|
- name: PGPOOL_ENABLE_LOG_HOSTNAME
|
|
value: "yes"
|
|
- name: PGPOOL_ENABLE_LOG_PER_NODE_STATEMENT
|
|
value: "no"
|
|
- name: PGPOOL_RESERVED_CONNECTIONS
|
|
value: '1'
|
|
- name: PGPOOL_CHILD_LIFE_TIME
|
|
value: ""
|
|
- name: PGPOOL_ENABLE_TLS
|
|
value: "no"
|
|
- name: PGPOOL_HEALTH_CHECK_PSQL_TIMEOUT
|
|
value: "6"
|
|
envFrom:
|
|
ports:
|
|
- name: postgresql
|
|
containerPort: 5432
|
|
protocol: TCP
|
|
livenessProbe:
|
|
failureThreshold: 5
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 5
|
|
exec:
|
|
command:
|
|
- /opt/bitnami/scripts/pgpool/healthcheck.sh
|
|
readinessProbe:
|
|
failureThreshold: 5
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
successThreshold: 1
|
|
timeoutSeconds: 5
|
|
exec:
|
|
command:
|
|
- bash
|
|
- -ec
|
|
- PGPASSWORD=${PGPOOL_POSTGRES_PASSWORD} psql -U "gitea" -d "gitea" -h /opt/bitnami/pgpool/tmp -tA -c "SELECT 1" >/dev/null
|
|
resources:
|
|
limits: {}
|
|
requests: {} |