IB Gateway Helm chart
Deploy the community-maintained IB Gateway Docker runtime with a pinned image, Secret-file credentials, persistent settings, External Secrets, restricted TCP Services, and product-aware health checks.
Features
- Immutable multi-architecture image selection and a hardened non-root Pod.
- Paper, live, or simultaneous sessions with conservative trading defaults.
- Secret-file passwords, existing Secret mappings, and External Secrets support.
- Retained TWS settings with product-aware startup, readiness, and liveness.
- Private named-port Services, NetworkPolicy, dual stack, and optional VNC.
- Optional singleton disruption protection with an explicit node-drain warning.
Install
Create a mode-0600 password file outside the repository, then create a Secret
without placing the password in shell history:
kubectl -n ib-gateway create secret generic ib-gateway-credentials \
--from-literal=username='your-username' \
--from-file=password=/secure/path/ibkr-password
helm install ib-gateway oci://ghcr.io/helmforgedev/helm/ib-gateway \
--version 1.0.1 \
--namespace ib-gateway \
--create-namespace \
--set auth.existingSecret=ib-gateway-credentials
Protect that temporary file and remove it securely after confirming the Secret exists.
The default mode is paper trading with read-only API access. Confirm that mode and the target account before enabling live trading.
Architecture
The container runs IB Gateway through IBC, Xvfb, and socat. The chart exposes
friendly Service ports 4001 for live trading and 4002 for paper trading while
targeting the upstream proxy listeners on 4003 and 4004. It enforces one replica
and a Recreate strategy because concurrent IBKR sessions are not safe high
availability and can evict one another.
Ports 4003, 4004, and 5900 are fixed by the upstream socat and x11vnc
processes. The chart deliberately keeps those container ports fixed; only the
client-facing Service ports are configurable.
The image is maintained by the gnzsnz/ib-gateway-docker project and includes
proprietary Interactive Brokers software. It is not an official Interactive
Brokers image. HelmForge and the image project are not affiliated with or
endorsed by Interactive Brokers.
Image provenance
The default image is ghcr.io/gnzsnz/ib-gateway:10.52, pinned to manifest
digest sha256:b72591b3b0965d4d29cec25163ff8d5f08e6b549c2fe0ce84944b4d173c9b652.
The Linux amd64 and arm64 manifests were verified on 2026-11-19.
Credentials and External Secrets
Passwords are projected from a Secret and passed through upstream _FILE
variables. Usernames use secretKeyRef; credentials are never written to a
ConfigMap. auth.existingSecret is the recommended production contract.
The canonical externalSecrets.items contract can materialize that Secret from
External Secrets Operator. See credentials and External Secrets
for required keys and rotation behavior.
Networking
The IBKR API is unauthenticated and unencrypted TCP. Keep the Service internal, restrict callers with NetworkPolicy, and use a private encrypted network between clients and the cluster. The chart intentionally provides no Ingress or Gateway API resource because those HTTP routing abstractions do not secure this protocol.
VNC is disabled by default and uses a separate ClusterIP Service when enabled. Use port-forwarding or a private access path rather than exposing it publicly. See networking.
Health contract
The upstream image has no HTTP health endpoint. Startup and readiness probes
check the active internal Gateway listener on 127.0.0.1:4001 or 4002 instead of
the earlier-starting public socat proxy. Liveness verifies the relevant IBC
process marker conservatively to avoid restart loops during IBKR outages.
When credentials are configured, readiness proves a local API listener exists. An empty evaluation install instead reports the credential-waiting process as ready so operators can inspect logs and add a Secret; its Service is not usable until credentials are configured and the internal listener starts. Neither signal proves an account can place orders, that market data is subscribed, or that upstream services are healthy.
State, 2FA, and recovery
The PVC stores /home/ibgateway/tws_settings. Credentials and generated IBC
configuration are not persisted there. A persisted jts.ini can retain the
initial timezone, so later gateway.timeZone changes may require deliberate
settings cleanup.
Daily restart automation can maintain a session, but manual two-factor approval is still periodically required. Back up settings only when their customization is valuable; account and trading state remain external to this chart. See operations and 2FA.
Set podDisruptionBudget.enabled: true only when blocking voluntary eviction of
the singleton is preferable to completing an unattended node drain. The budget
uses minAvailable: 1; it does not make the workload highly available.
Values & Configuration Reference
All schema parameters, types, defaults, and allowed values are extracted directly from the chart repository. Filter and search them in the interactive reference below or customize in Values Studio.
| --- | --- | --- |
| image.tag | 10.52 | Release channel paired with an immutable digest |
| replicaCount | 1 | Enforced singleton session owner |
| gateway.tradingMode | paper | paper, live, or both |
| gateway.readOnlyApi | true | Disable order-changing API calls |
| auth.existingSecret | "" | Existing credential Secret |
| externalSecrets.enabled | false | Materialize Secrets through ESO |
| persistence.enabled | true | Persist TWS settings |
| podDisruptionBudget.enabled | false | Block voluntary eviction of the singleton |
| service.type | ClusterIP | Internal raw-TCP access |
| vnc.enabled | false | Optional maintenance VNC listener |
| networkPolicy.enabled | true | Restrict API and VNC clients |
| networkPolicy.egressIsolation | false | Opt-in explicit egress policy |
Every value is documented in values.yaml and validated by values.schema.json.
Examples
- Paper trading keeps the safe default mode.
- Live trading shows the deliberate live-mode switch.
- Live and paper configures both account sessions.
- External Secrets materializes credential keys.
Review account identity, Secret references, NetworkPolicy peers, and Service exposure before applying any example.
Troubleshooting
Inspect rollout state, login logs, and recent cluster events before weakening a probe or network policy:
kubectl -n ib-gateway rollout status deployment/ib-gateway
kubectl -n ib-gateway logs deployment/ib-gateway --tail=200
kubectl -n ib-gateway get events --sort-by=.lastTimestamp
If readiness remains false, look for two-factor timeouts, competing sessions, or a missing internal 4001/4002 listener. A listening 4003/4004 proxy alone does not prove that authentication completed.
Security scan
Security scan results use the same Kubescape policy set as HelmForge CI.
Security Scan: ib-gateway
| Framework | Score |
|---|---|
| MITRE | 100.00% |
| NSA | 95.00% |
| SOC 2 | 100.00% |
| Aggregate resource score | 96.97% |
Kubescape reported no critical, high, or medium-severity failures. The remaining low finding is the writable root filesystem required by the upstream desktop runtime; non-root execution, dropped capabilities, seccomp, and disabled privilege escalation remain enforced.
Limitations
- IBC was retired by its maintainers on 2026-09-01 and now receives limited maintenance.
- There is no supported horizontal scaling or rolling update model.
- No documented Prometheus endpoint exists, so the chart does not publish a misleading ServiceMonitor.
- The chart cannot automate IBKR account enrollment, two-factor approval, subscriptions, permissions, or trading-risk controls.
- Use of the image and IB Gateway remains subject to upstream licenses and IBKR agreements.
Additional documentation
System Architecture
DESIGN.md SyncedVerified architecture contract rendered dynamically from GitHub DESIGN.md
flowchart LR client[Trading client] --> api[Live or paper Service] operator[Operator] -. temporary port-forward .-> vnc[VNC Service] api --> gateway[IB Gateway Deployment] vnc --> gateway credentials[Secret or ExternalSecret] --> gateway gateway --> settings[(Settings PVC)] gateway --> ibkr[IBKR services]
IB Gateway Values Schema Reference
Official schema parameters, default values, and types extracted directly from the chart repository.
Global(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| global | object | - | Chart configuration parameter |
Name Override(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| nameOverride | string | - | Chart configuration parameter |
Fullname Override(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| fullnameOverride | string | - | Chart configuration parameter |
Replica Count(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| replicaCount | integer | 1 | Chart configuration parameter |
Common Labels(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| commonLabels | object | - | Chart configuration parameter |
Common Annotations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| commonAnnotations | object | - | Chart configuration parameter |
Pod Labels(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podLabels | object | - | Chart configuration parameter |
Pod Annotations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podAnnotations | object | - | Chart configuration parameter |
Image Pull Secrets(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| imagePullSecrets | array | - | Chart configuration parameter |
Image(4)
| Parameter | Type | Default | Description |
|---|---|---|---|
| image.repository | string | - | Chart configuration parameter |
| image.tag | string | - | Chart configuration parameter |
| image.digest | string | - | Chart configuration parameter |
| image.pullPolicy | string | - | Chart configuration parameter Allowed: AlwaysIfNotPresentNever |
Authentication(9)
| Parameter | Type | Default | Description |
|---|---|---|---|
| auth.existingSecret | string | - | Chart configuration parameter |
| auth.username | string | - | Chart configuration parameter |
| auth.password | string | - | Chart configuration parameter |
| auth.paperUsername | string | - | Chart configuration parameter |
| auth.paperPassword | string | - | Chart configuration parameter |
| auth.usernameKey | string | - | Chart configuration parameter |
| auth.passwordKey | string | - | Chart configuration parameter |
| auth.paperUsernameKey | string | - | Chart configuration parameter |
| auth.paperPasswordKey | string | - | Chart configuration parameter |
External Secrets(3)
| Parameter | Type | Default | Description |
|---|---|---|---|
| externalSecrets.enabled | boolean | - | Chart configuration parameter |
| externalSecrets.refreshInterval | string | - | Chart configuration parameter |
| externalSecrets.items | array | - | Chart configuration parameter |
Gateway(17)
| Parameter | Type | Default | Description |
|---|---|---|---|
| gateway.tradingMode | string | - | Chart configuration parameter Allowed: paperliveboth |
| gateway.readOnlyApi | boolean | - | Chart configuration parameter |
| gateway.acceptIncoming | string | - | Chart configuration parameter Allowed: manualacceptreject |
| gateway.masterClientId | stringinteger | - | Chart configuration parameter |
| gateway.allowBlindTrading | boolean | - | Chart configuration parameter |
| gateway.timeZone | string | - | Chart configuration parameter |
| gateway.javaHeapSize | integer | - | Chart configuration parameter |
| gateway.twoFactorTimeoutAction | string | - | Chart configuration parameter Allowed: exitrestart |
| gateway.twoFactorExitInterval | integer | - | Chart configuration parameter |
| gateway.twoFactorDevice | string | - | Chart configuration parameter |
| gateway.reloginAfterTwoFactorTimeout | boolean | - | Chart configuration parameter |
| gateway.existingSessionDetectedAction | string | - | Chart configuration parameter Allowed: manualprimarysecondaryprimaryoverride |
| gateway.autoRestartTime | string | - | Chart configuration parameter |
| gateway.autoLogoffTime | string | - | Chart configuration parameter |
| gateway.coldRestartTime | string | - | Chart configuration parameter |
| gateway.saveSettingsAt | string | - | Chart configuration parameter |
| gateway.customConfig | boolean | - | Chart configuration parameter |
Workload(8)
| Parameter | Type | Default | Description |
|---|---|---|---|
| workload.command | array | - | Chart configuration parameter |
| workload.args | array | - | Chart configuration parameter |
| workload.extraEnv | array | - | Chart configuration parameter |
| workload.envFrom | array | - | Chart configuration parameter |
| workload.extraVolumeMounts | array | - | Chart configuration parameter |
| workload.extraVolumes | array | - | Chart configuration parameter |
| workload.initContainers | array | - | Chart configuration parameter |
| workload.sidecars | array | - | Chart configuration parameter |
Persistence(7)
| Parameter | Type | Default | Description |
|---|---|---|---|
| persistence.enabled | boolean | - | Chart configuration parameter |
| persistence.existingClaim | string | - | Chart configuration parameter |
| persistence.storageClass | string | - | Chart configuration parameter |
| persistence.size | string | - | Chart configuration parameter |
| persistence.accessModes | array | - | Chart configuration parameter |
| persistence.retain | boolean | - | Chart configuration parameter |
| persistence.annotations | object | - | Chart configuration parameter |
Pod Disruption Budget(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podDisruptionBudget.enabled | boolean | - | Chart configuration parameter |
Service Account(4)
| Parameter | Type | Default | Description |
|---|---|---|---|
| serviceAccount.create | boolean | - | Chart configuration parameter |
| serviceAccount.name | string | - | Chart configuration parameter |
| serviceAccount.annotations | object | - | Chart configuration parameter |
| serviceAccount.automountServiceAccountToken | boolean | - | Chart configuration parameter |
Service & Networking(7)
| Parameter | Type | Default | Description |
|---|---|---|---|
| service.type | string | - | Chart configuration parameter Allowed: ClusterIPNodePortLoadBalancer |
| service.annotations | object | - | Chart configuration parameter |
| service.livePort | integer | - | Chart configuration parameter |
| service.paperPort | integer | - | Chart configuration parameter |
| service.ipFamilyPolicy | string | - | Chart configuration parameter Allowed: SingleStackPreferDualStackRequireDualStack |
| service.ipFamilies | array | - | Chart configuration parameter |
| service.loadBalancerSourceRanges | array | - | Chart configuration parameter |
Vnc(9)
| Parameter | Type | Default | Description |
|---|---|---|---|
| vnc.enabled | boolean | - | Chart configuration parameter |
| vnc.existingSecret | string | - | Chart configuration parameter |
| vnc.password | string | - | Chart configuration parameter |
| vnc.passwordKey | string | - | Chart configuration parameter |
| vnc.service.type | string | - | Chart configuration parameter Allowed: ClusterIPNodePortLoadBalancer |
| vnc.service.port | integer | - | Chart configuration parameter |
| vnc.service.annotations | object | - | Chart configuration parameter |
| vnc.service.ipFamilyPolicy | string | - | Chart configuration parameter Allowed: SingleStackPreferDualStackRequireDualStack |
| vnc.service.ipFamilies | array | - | Chart configuration parameter |
Network Policy(6)
| Parameter | Type | Default | Description |
|---|---|---|---|
| networkPolicy.enabled | boolean | - | Chart configuration parameter |
| networkPolicy.apiIngressFrom | array | - | Chart configuration parameter |
| networkPolicy.vncIngressFrom | array | - | Chart configuration parameter |
| networkPolicy.egressIsolation | boolean | - | Chart configuration parameter |
| networkPolicy.dnsEgress | array | - | Chart configuration parameter |
| networkPolicy.extraEgress | array | - | Chart configuration parameter |
Health Probes(15)
| Parameter | Type | Default | Description |
|---|---|---|---|
| probes.startup.enabled | boolean | - | Chart configuration parameter |
| probes.startup.command | array | - | Chart configuration parameter |
| probes.startup.periodSeconds | integer | - | Chart configuration parameter |
| probes.startup.timeoutSeconds | integer | - | Chart configuration parameter |
| probes.startup.failureThreshold | integer | - | Chart configuration parameter |
| probes.readiness.enabled | boolean | - | Chart configuration parameter |
| probes.readiness.command | array | - | Chart configuration parameter |
| probes.readiness.periodSeconds | integer | - | Chart configuration parameter |
| probes.readiness.timeoutSeconds | integer | - | Chart configuration parameter |
| probes.readiness.failureThreshold | integer | - | Chart configuration parameter |
| probes.liveness.enabled | boolean | - | Chart configuration parameter |
| probes.liveness.command | array | - | Chart configuration parameter |
| probes.liveness.periodSeconds | integer | - | Chart configuration parameter |
| probes.liveness.timeoutSeconds | integer | - | Chart configuration parameter |
| probes.liveness.failureThreshold | integer | - | Chart configuration parameter |
Termination Grace Period Seconds(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminationGracePeriodSeconds | integer | - | Chart configuration parameter |
Resources(6)
| Parameter | Type | Default | Description |
|---|---|---|---|
| resources.requests.cpu | stringnumber | - | Chart configuration parameter |
| resources.requests.memory | stringnumber | - | Chart configuration parameter |
| resources.requests.ephemeral-storage | stringnumber | - | Chart configuration parameter |
| resources.limits.cpu | stringnumber | - | Chart configuration parameter |
| resources.limits.memory | stringnumber | - | Chart configuration parameter |
| resources.limits.ephemeral-storage | stringnumber | - | Chart configuration parameter |
Pod Security(6)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podSecurityContext.runAsNonRoot | any | true | Chart configuration parameter |
| podSecurityContext.runAsUser | integer | - | Chart configuration parameter |
| podSecurityContext.runAsGroup | integer | - | Chart configuration parameter |
| podSecurityContext.fsGroup | integer | - | Chart configuration parameter |
| podSecurityContext.fsGroupChangePolicy | select | - | Chart configuration parameter Allowed: AlwaysOnRootMismatch |
| podSecurityContext.seccompProfile.type | any | RuntimeDefault | Chart configuration parameter |
Container Security(3)
| Parameter | Type | Default | Description |
|---|---|---|---|
| securityContext.allowPrivilegeEscalation | any | false | Chart configuration parameter |
| securityContext.readOnlyRootFilesystem | boolean | - | Chart configuration parameter |
| securityContext.capabilities.drop | array | - | Chart configuration parameter |
Node Selector(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| nodeSelector | object | - | Chart configuration parameter |
Tolerations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| tolerations | array | - | Chart configuration parameter |
Affinity(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| affinity | object | - | Chart configuration parameter |
Priority Class Name(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| priorityClassName | string | - | Chart configuration parameter |
Topology Spread Constraints(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| topologySpreadConstraints | array | - | Chart configuration parameter |
Extra Manifests(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraManifests | array | - | Chart configuration parameter |
No schema parameters match your search
Try searching for a different keyword or reset the filter.