fix: wait for files postgres readiness

This commit is contained in:
Grendgi
2026-06-16 13:22:08 +03:00
parent 79eac4d251
commit dff97c55dc
3 changed files with 6 additions and 2 deletions

View File

@@ -51,6 +51,8 @@ jobs:
kubectl apply -f k8s/secrets.yaml kubectl apply -f k8s/secrets.yaml
kubectl apply -f k8s/configmap.yaml kubectl apply -f k8s/configmap.yaml
kubectl apply -f k8s/postgres.yaml kubectl apply -f k8s/postgres.yaml
kubectl -n files rollout status statefulset/postgres --timeout=240s
kubectl -n files wait --for=condition=ready pod -l app=files-postgres --timeout=240s
kubectl apply -f k8s/server-deployment.yaml kubectl apply -f k8s/server-deployment.yaml
kubectl apply -f k8s/server-service.yaml kubectl apply -f k8s/server-service.yaml
kubectl -n files set image deployment/files-server \ kubectl -n files set image deployment/files-server \

View File

@@ -28,7 +28,7 @@ func main() {
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop() defer stop()
pool, err := commondb.ConnectWithRetry(ctx, cfg.DatabaseURL, 2*time.Minute) pool, err := commondb.ConnectWithRetry(ctx, cfg.DatabaseURL, 10*time.Minute)
if err != nil { if err != nil {
slog.Error("connect database", "error", err) slog.Error("connect database", "error", err)
os.Exit(1) os.Exit(1)

View File

@@ -34,6 +34,9 @@ spec:
envFrom: envFrom:
- secretRef: - secretRef:
name: postgres-secret name: postgres-secret
env:
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts: volumeMounts:
- name: data - name: data
mountPath: /var/lib/postgresql/data mountPath: /var/lib/postgresql/data
@@ -52,4 +55,3 @@ spec:
resources: resources:
requests: requests:
storage: 10Gi storage: 10Gi