You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
3.5 KiB
117 lines
3.5 KiB
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/component: primary
|
|
app.kubernetes.io/instance: statping
|
|
app.kubernetes.io/name: postgresql
|
|
name: statping-postgresql
|
|
namespace: default
|
|
spec:
|
|
podManagementPolicy: OrderedReady
|
|
replicas: 1
|
|
revisionHistoryLimit: 10
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: primary
|
|
app.kubernetes.io/instance: statping
|
|
app.kubernetes.io/name: postgresql
|
|
serviceName: statping-postgresql-hl
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/component: primary
|
|
app.kubernetes.io/instance: statping
|
|
app.kubernetes.io/name: postgresql
|
|
name: statping-postgresql
|
|
spec:
|
|
containers:
|
|
- env:
|
|
- name: BITNAMI_DEBUG
|
|
value: "false"
|
|
- name: POSTGRESQL_PORT_NUMBER
|
|
value: "5432"
|
|
- name: POSTGRESQL_VOLUME_DIR
|
|
value: /bitnami/postgresql
|
|
- name: PGDATA
|
|
value: /bitnami/postgresql/data
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: postgres-password
|
|
name: statping-postgresql
|
|
- name: POSTGRES_DB
|
|
value: postgres
|
|
- name: POSTGRESQL_ENABLE_LDAP
|
|
value: "no"
|
|
- name: POSTGRESQL_ENABLE_TLS
|
|
value: "no"
|
|
- name: POSTGRESQL_LOG_HOSTNAME
|
|
value: "false"
|
|
- name: POSTGRESQL_LOG_CONNECTIONS
|
|
value: "false"
|
|
- name: POSTGRESQL_LOG_DISCONNECTIONS
|
|
value: "false"
|
|
- name: POSTGRESQL_PGAUDIT_LOG_CATALOG
|
|
value: "off"
|
|
- name: POSTGRESQL_CLIENT_MIN_MESSAGES
|
|
value: error
|
|
- name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES
|
|
value: pgaudit
|
|
image: docker.io/bitnami/postgresql:14.4.0-debian-11-r4
|
|
imagePullPolicy: IfNotPresent
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- exec pg_isready -U "postgres" -d "dbname=postgres" -h 127.0.0.1 -p 5432
|
|
failureThreshold: 6
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 5
|
|
name: postgresql
|
|
ports:
|
|
- containerPort: 5432
|
|
name: tcp-postgresqlh
|
|
protocol: TCP
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- -e
|
|
- |
|
|
exec pg_isready -U "postgres" -d "dbname=postgres" -h 127.0.0.1 -p 5432
|
|
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
|
|
failureThreshold: 6
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 5
|
|
volumeMounts:
|
|
- mountPath: /dev/shm
|
|
name: dshm
|
|
- mountPath: /bitnami/postgresql
|
|
name: data
|
|
restartPolicy: Always
|
|
volumes:
|
|
- emptyDir:
|
|
medium: Memory
|
|
name: dshm
|
|
updateStrategy:
|
|
type: RollingUpdate
|
|
volumeClaimTemplates:
|
|
- apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: data
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: 8Gi
|
|
volumeMode: Filesystem
|