diff --git a/workloads/nextcloud/postgres-deploy.yml b/workloads/nextcloud/postgres-deploy.yml new file mode 100644 index 0000000..c59980e --- /dev/null +++ b/workloads/nextcloud/postgres-deploy.yml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: postgres + namespace: nextcloud +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: postgres + template: + metadata: + labels: + app: postgres + spec: + containers: + - image: postgres:12.2-alpine + imagePullPolicy: IfNotPresent + name: postgres + env: + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: postgres + key: POSTGRES_USER + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: postgres + key: POSTGRES_PASSWORD + resources: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "512Mi" + cpu: "1000m" + livenessProbe: + tcpSocket: + port: 5432 + initialDelaySeconds: 15 + periodSeconds: 30 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 2 + ports: + - containerPort: 5432 + volumeMounts: + - name: postgres-data + mountPath: /var/lib/postgresql/data + volumes: + - name: postgres-data + hostPath: + path: /opt/nextcloud/postgres + type: Directory