diff --git a/infra/k8s/services/ib-gateway.yaml b/infra/k8s/services/ib-gateway.yaml index f45b133..96c64b1 100644 --- a/infra/k8s/services/ib-gateway.yaml +++ b/infra/k8s/services/ib-gateway.yaml @@ -76,8 +76,11 @@ spec: # full re-login each time). 08:00 UTC is clear of the 14:35 rebalancer + 23:30 nightly windows. - name: TIME_ZONE value: "Etc/UTC" + # MUST be zero-padded hh:mm (IBC's parser rejects "8:00 AM" with "Auto restart time setting must be + # hh:mm AM or hh:mm PM" — the rejection left the daily auto-restart UNCONFIGURED, so the gateway + # churned ~16 restarts/day instead of one clean daily cycle. Verified in the pod log 2026-07-20.) - name: AUTO_RESTART_TIME - value: "8:00 AM" + value: "08:00 AM" # Persist jts.ini + IBC config across pod restarts (a fresh empty volume just does a clean first-run # login) so settings survive a deploy/reschedule instead of being rebuilt each time. - name: TWS_SETTINGS_PATH @@ -105,7 +108,9 @@ spec: port: 4002 initialDelaySeconds: 120 periodSeconds: 30 - failureThreshold: 5 + # 6×30s = 180s tolerance: the daily auto-restart + IBKR reauth window drops port 4002 for up to a + # couple of minutes; too tight a threshold would k8s-kill the pod mid-reauth and compound the churn. + failureThreshold: 6 volumeMounts: - name: tws-settings mountPath: /home/ibgateway/tws_settings