use statefulSets and readinessProbes instead of initContainers

This commit is contained in:
2025-12-17 20:43:24 +05:30
parent 239655d713
commit 2bc8629208
5 changed files with 38 additions and 52 deletions

View File

@@ -1,15 +1,15 @@
---
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: gitea-db
namespace: git-ops
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: gitea-db
serviceName: gitea-db
replicas: 1
template:
metadata:
labels:
@@ -40,7 +40,12 @@ spec:
volumeMounts:
- name: gitea-db
mountPath: /var/lib/postgresql
volumes:
- name: gitea-db
persistentVolumeClaim:
claimName: gitea-db-new-longhorn
volumeClaimTemplates:
- metadata:
name: gitea-db
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 2Gi
storageClassName: longhorn