Fix Redis connection in production with startup probe and explicit 127.0.0.1
Changes: - Added startupProbe to towerops container to allow up to 70s for startup (gives Valkey sidecar time to be ready) - Changed REDIS_HOST from 'localhost' to '127.0.0.1' for explicit loopback - Removed initialDelaySeconds from liveness/readiness probes (handled by startup) - Added comment clarifying Redis connects to Valkey sidecar This ensures the app waits for Valkey to be ready before accepting traffic.
This commit is contained in:
parent
d81b025282
commit
5836925166
1 changed files with 10 additions and 3 deletions
|
|
@ -84,8 +84,9 @@ spec:
|
|||
secretKeyRef:
|
||||
name: towerops-secrets
|
||||
key: SECRET_KEY_BASE
|
||||
# Redis connection to Valkey sidecar container (localhost because same pod)
|
||||
- name: REDIS_HOST
|
||||
value: "localhost"
|
||||
value: "127.0.0.1"
|
||||
- name: REDIS_PORT
|
||||
value: "6379"
|
||||
envFrom:
|
||||
|
|
@ -100,11 +101,18 @@ spec:
|
|||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "500m"
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 4000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 12 # 10s + (12 * 5s) = 70s max startup time
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 4000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
|
|
@ -112,7 +120,6 @@ spec:
|
|||
httpGet:
|
||||
path: /health
|
||||
port: 4000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 3
|
||||
timeoutSeconds: 2
|
||||
successThreshold: 1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue