fix: wait for files postgres readiness
This commit is contained in:
@@ -51,6 +51,8 @@ jobs:
|
||||
kubectl apply -f k8s/secrets.yaml
|
||||
kubectl apply -f k8s/configmap.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-service.yaml
|
||||
kubectl -n files set image deployment/files-server \
|
||||
|
||||
@@ -28,7 +28,7 @@ func main() {
|
||||
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||
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 {
|
||||
slog.Error("connect database", "error", err)
|
||||
os.Exit(1)
|
||||
|
||||
@@ -34,6 +34,9 @@ spec:
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: postgres-secret
|
||||
env:
|
||||
- name: PGDATA
|
||||
value: /var/lib/postgresql/data/pgdata
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
@@ -52,4 +55,3 @@ spec:
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user