Revert "Use existing encrypted PVCs and postgres deployment"

This reverts commit 8cac765a64.
This commit is contained in:
CTO Agent 2026-07-26 10:04:28 +00:00
parent 8cac765a64
commit c7c0ac2998
4 changed files with 111 additions and 1 deletions

View file

@ -111,4 +111,4 @@ spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: paperclip-data-encrypted
claimName: paperclip-data

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: paperclip-postgres
namespace: paperclip
spec:
type: ClusterIP
selector:
app: paperclip-postgres
ports:
- name: postgres
port: 5432
targetPort: 5432
protocol: TCP

View file

@ -0,0 +1,80 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: paperclip-postgres
namespace: paperclip
spec:
serviceName: paperclip-postgres
replicas: 1
selector:
matchLabels:
app: paperclip-postgres
template:
metadata:
labels:
app: paperclip-postgres
spec:
containers:
- name: postgres
image: postgres:16-alpine
imagePullPolicy: IfNotPresent
ports:
- name: postgres
containerPort: 5432
protocol: TCP
env:
- name: POSTGRES_DB
value: paperclip
- name: POSTGRES_USER
value: paperclip
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: paperclip-secrets
key: POSTGRES_PASSWORD
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 1000m
memory: 2Gi
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
subPath: pgdata
livenessProbe:
exec:
command:
- /bin/sh
- -c
- pg_isready -U paperclip
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
readinessProbe:
exec:
command:
- /bin/sh
- -c
- pg_isready -U paperclip
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 3
volumeClaimTemplates:
- metadata:
name: postgres-data
annotations:
# Prevent Argo CD from deleting this PVC to avoid data loss
argocd.argoproj.io/sync-options: Delete=false
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 20Gi

16
apps/paperclip/pvc.yaml Normal file
View file

@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: paperclip-data
namespace: paperclip
annotations:
# Prevent Argo CD from deleting this PVC to avoid data loss
argocd.argoproj.io/sync-options: Delete=false
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Gi
storageClassName: local-path
volumeMode: Filesystem