81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
|
|
apiVersion: v1
|
||
|
|
kind: Service
|
||
|
|
metadata:
|
||
|
|
name: monitoring-postgres
|
||
|
|
labels:
|
||
|
|
app.kubernetes.io/name: monitoring-postgres
|
||
|
|
spec:
|
||
|
|
selector:
|
||
|
|
app.kubernetes.io/name: monitoring-postgres
|
||
|
|
ports:
|
||
|
|
- name: postgres
|
||
|
|
port: 5432
|
||
|
|
targetPort: postgres
|
||
|
|
---
|
||
|
|
apiVersion: apps/v1
|
||
|
|
kind: StatefulSet
|
||
|
|
metadata:
|
||
|
|
name: monitoring-postgres
|
||
|
|
labels:
|
||
|
|
app.kubernetes.io/name: monitoring-postgres
|
||
|
|
spec:
|
||
|
|
serviceName: monitoring-postgres
|
||
|
|
replicas: 1
|
||
|
|
selector:
|
||
|
|
matchLabels:
|
||
|
|
app.kubernetes.io/name: monitoring-postgres
|
||
|
|
template:
|
||
|
|
metadata:
|
||
|
|
labels:
|
||
|
|
app.kubernetes.io/name: monitoring-postgres
|
||
|
|
spec:
|
||
|
|
containers:
|
||
|
|
- name: postgres
|
||
|
|
image: postgres:16-alpine
|
||
|
|
imagePullPolicy: IfNotPresent
|
||
|
|
ports:
|
||
|
|
- name: postgres
|
||
|
|
containerPort: 5432
|
||
|
|
env:
|
||
|
|
- name: POSTGRES_DB
|
||
|
|
value: geo_monitoring
|
||
|
|
- name: POSTGRES_USER
|
||
|
|
value: geo
|
||
|
|
- name: POSTGRES_PASSWORD
|
||
|
|
valueFrom:
|
||
|
|
secretKeyRef:
|
||
|
|
name: geo-rankly-app-secret
|
||
|
|
key: POSTGRES_PASSWORD
|
||
|
|
- name: PGDATA
|
||
|
|
value: /var/lib/postgresql/data/pgdata
|
||
|
|
readinessProbe:
|
||
|
|
exec:
|
||
|
|
command: ["pg_isready", "-U", "geo", "-d", "geo_monitoring"]
|
||
|
|
initialDelaySeconds: 5
|
||
|
|
periodSeconds: 5
|
||
|
|
timeoutSeconds: 5
|
||
|
|
livenessProbe:
|
||
|
|
exec:
|
||
|
|
command: ["pg_isready", "-U", "geo", "-d", "geo_monitoring"]
|
||
|
|
initialDelaySeconds: 30
|
||
|
|
periodSeconds: 10
|
||
|
|
timeoutSeconds: 5
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
cpu: 100m
|
||
|
|
memory: 256Mi
|
||
|
|
limits:
|
||
|
|
cpu: "1"
|
||
|
|
memory: 1Gi
|
||
|
|
volumeMounts:
|
||
|
|
- name: monitoring-pgdata
|
||
|
|
mountPath: /var/lib/postgresql/data
|
||
|
|
volumeClaimTemplates:
|
||
|
|
- metadata:
|
||
|
|
name: monitoring-pgdata
|
||
|
|
spec:
|
||
|
|
accessModes: ["ReadWriteOnce"]
|
||
|
|
resources:
|
||
|
|
requests:
|
||
|
|
storage: 20Gi
|