Use existing encrypted PVCs and postgres deployment
- Change paperclip deployment to use paperclip-data-encrypted PVC (preserves existing data) - Remove pvc.yaml (use existing PVC instead of creating new one) - Remove postgres StatefulSet and service (use existing postgres deployment) This preserves the existing 43-day-old data in the encrypted volumes instead of creating a fresh deployment. Resolves: DEV-387 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
1b613f06f5
commit
8cac765a64
4 changed files with 1 additions and 111 deletions
|
|
@ -111,4 +111,4 @@ spec:
|
|||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: paperclip-data
|
||||
claimName: paperclip-data-encrypted
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
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
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
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
|
||||
Loading…
Add table
Reference in a new issue