66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: timescaledb
|
|
spec:
|
|
serviceName: timescaledb
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: timescaledb
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: timescaledb
|
|
spec:
|
|
containers:
|
|
- name: timescaledb
|
|
image: timescale/timescaledb:latest-pg15
|
|
ports:
|
|
- containerPort: 5432
|
|
name: postgres
|
|
env:
|
|
- name: POSTGRES_USER
|
|
value: monitor
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: timescaledb-secret
|
|
key: password
|
|
- name: POSTGRES_DB
|
|
value: monitor
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /var/lib/postgresql/data
|
|
- name: init-scripts
|
|
mountPath: /docker-entrypoint-initdb.d
|
|
livenessProbe:
|
|
exec:
|
|
command: ["pg_isready", "-U", "monitor", "-d", "monitor"]
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
exec:
|
|
command: ["pg_isready", "-U", "monitor", "-d", "monitor"]
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: init-scripts
|
|
configMap:
|
|
name: timescaledb-init
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: data
|
|
spec:
|
|
accessModes: ["ReadWriteOnce"]
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|