2026-03-16 18:58:35 +01:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: StatefulSet
|
|
|
|
|
metadata:
|
|
|
|
|
name: postgres
|
|
|
|
|
namespace: cameleer
|
|
|
|
|
spec:
|
|
|
|
|
serviceName: postgres
|
|
|
|
|
replicas: 1
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: postgres
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
app: postgres
|
|
|
|
|
spec:
|
|
|
|
|
containers:
|
|
|
|
|
- name: postgres
|
2026-03-16 19:14:15 +01:00
|
|
|
image: timescale/timescaledb-ha:pg16
|
2026-03-16 18:58:35 +01:00
|
|
|
ports:
|
|
|
|
|
- containerPort: 5432
|
|
|
|
|
name: postgres
|
|
|
|
|
env:
|
|
|
|
|
- name: POSTGRES_DB
|
|
|
|
|
value: cameleer3
|
|
|
|
|
- name: POSTGRES_USER
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: postgres-credentials
|
|
|
|
|
key: POSTGRES_USER
|
|
|
|
|
- name: POSTGRES_PASSWORD
|
|
|
|
|
valueFrom:
|
|
|
|
|
secretKeyRef:
|
|
|
|
|
name: postgres-credentials
|
|
|
|
|
key: POSTGRES_PASSWORD
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- name: data
|
2026-03-17 01:00:20 +01:00
|
|
|
mountPath: /home/postgres/pgdata
|
2026-03-16 18:58:35 +01:00
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
memory: "1Gi"
|
|
|
|
|
cpu: "200m"
|
|
|
|
|
limits:
|
|
|
|
|
memory: "4Gi"
|
|
|
|
|
cpu: "1000m"
|
|
|
|
|
livenessProbe:
|
|
|
|
|
exec:
|
|
|
|
|
command:
|
|
|
|
|
- pg_isready
|
|
|
|
|
- -U
|
|
|
|
|
- cameleer
|
|
|
|
|
- -d
|
|
|
|
|
- cameleer3
|
|
|
|
|
initialDelaySeconds: 15
|
|
|
|
|
periodSeconds: 10
|
|
|
|
|
timeoutSeconds: 3
|
|
|
|
|
failureThreshold: 3
|
|
|
|
|
readinessProbe:
|
|
|
|
|
exec:
|
|
|
|
|
command:
|
|
|
|
|
- pg_isready
|
|
|
|
|
- -U
|
|
|
|
|
- cameleer
|
|
|
|
|
- -d
|
|
|
|
|
- cameleer3
|
|
|
|
|
initialDelaySeconds: 5
|
|
|
|
|
periodSeconds: 5
|
|
|
|
|
timeoutSeconds: 3
|
|
|
|
|
failureThreshold: 3
|
|
|
|
|
volumeClaimTemplates:
|
|
|
|
|
- metadata:
|
|
|
|
|
name: data
|
|
|
|
|
spec:
|
|
|
|
|
accessModes: ["ReadWriteOnce"]
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
storage: 10Gi
|
|
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
|
|
|
|
name: postgres
|
|
|
|
|
namespace: cameleer
|
|
|
|
|
spec:
|
|
|
|
|
clusterIP: None
|
|
|
|
|
selector:
|
|
|
|
|
app: postgres
|
|
|
|
|
ports:
|
|
|
|
|
- port: 5432
|
|
|
|
|
targetPort: 5432
|
|
|
|
|
name: postgres
|
2026-03-17 01:00:20 +01:00
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
|
|
|
|
name: postgres-external
|
|
|
|
|
namespace: cameleer
|
|
|
|
|
spec:
|
|
|
|
|
type: NodePort
|
|
|
|
|
selector:
|
|
|
|
|
app: postgres
|
|
|
|
|
ports:
|
|
|
|
|
- port: 5432
|
|
|
|
|
targetPort: 5432
|
|
|
|
|
nodePort: 30432
|