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

@@ -16,20 +16,19 @@ spec:
labels:
app: gitea-app
spec:
initContainers:
- name: wait-for-db
image: busybox
command:
- sh
- -c
- |
until nc -z -v -w30 gitea-db-service 5432; do
echo "Waiting for psql database to be ready"
sleep 2
done
containers:
- name: gitea
image: gitea/gitea:1.25.2
readinessProbe:
exec:
command:
- sh
- -c
- |
nc -z gitea-db.git-ops.svc.cluster.local 5432
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 3
ports:
- containerPort: 22
name: ssh
@@ -43,7 +42,7 @@ spec:
- name: GITEA__database__DB_TYPE
value: "postgres"
- name: GITEA__database__HOST
value: "gitea-db-service:5432"
value: "gitea-db.git-ops.svc.cluster.local:5432"
- name: GITEA__database__NAME
value: "gitea"
- name: GITEA__database__USER