use statefulSets and readinessProbes instead of initContainers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user