Skip to content
IB Gateway icon
v1.1.1App: v10.52Pinned DigestS3 Backup Ready

Production Helm chart • Apache-2.0 • Zero-Root • Verified on Kubernetes v1.33-v1.36+

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.

Official Schema

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.

View Values Schema

| --- | --- | --- | | 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

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 Synced

Verified 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]
Official Contractvalues.schema.json

IB Gateway Values Schema Reference

Official schema parameters, default values, and types extracted directly from the chart repository.

121 parametersValues Studio

Global(1)

ParameterTypeDefaultDescription
globalobject-Chart configuration parameter

Name Override(1)

ParameterTypeDefaultDescription
nameOverridestring-Chart configuration parameter

Fullname Override(1)

ParameterTypeDefaultDescription
fullnameOverridestring-Chart configuration parameter

Replica Count(1)

ParameterTypeDefaultDescription
replicaCountinteger1Chart configuration parameter

Common Labels(1)

ParameterTypeDefaultDescription
commonLabelsobject-Chart configuration parameter

Common Annotations(1)

ParameterTypeDefaultDescription
commonAnnotationsobject-Chart configuration parameter

Pod Labels(1)

ParameterTypeDefaultDescription
podLabelsobject-Chart configuration parameter

Pod Annotations(1)

ParameterTypeDefaultDescription
podAnnotationsobject-Chart configuration parameter

Image Pull Secrets(1)

ParameterTypeDefaultDescription
imagePullSecretsarray-Chart configuration parameter

Image(4)

ParameterTypeDefaultDescription
image.repositorystring-Chart configuration parameter
image.tagstring-Chart configuration parameter
image.digeststring-Chart configuration parameter
image.pullPolicystring-Chart configuration parameter
Allowed:AlwaysIfNotPresentNever

Authentication(9)

ParameterTypeDefaultDescription
auth.existingSecretstring-Chart configuration parameter
auth.usernamestring-Chart configuration parameter
auth.passwordstring-Chart configuration parameter
auth.paperUsernamestring-Chart configuration parameter
auth.paperPasswordstring-Chart configuration parameter
auth.usernameKeystring-Chart configuration parameter
auth.passwordKeystring-Chart configuration parameter
auth.paperUsernameKeystring-Chart configuration parameter
auth.paperPasswordKeystring-Chart configuration parameter

External Secrets(3)

ParameterTypeDefaultDescription
externalSecrets.enabledboolean-Chart configuration parameter
externalSecrets.refreshIntervalstring-Chart configuration parameter
externalSecrets.itemsarray-Chart configuration parameter

Gateway(17)

ParameterTypeDefaultDescription
gateway.tradingModestring-Chart configuration parameter
Allowed:paperliveboth
gateway.readOnlyApiboolean-Chart configuration parameter
gateway.acceptIncomingstring-Chart configuration parameter
Allowed:manualacceptreject
gateway.masterClientIdstringinteger-Chart configuration parameter
gateway.allowBlindTradingboolean-Chart configuration parameter
gateway.timeZonestring-Chart configuration parameter
gateway.javaHeapSizeinteger-Chart configuration parameter
gateway.twoFactorTimeoutActionstring-Chart configuration parameter
Allowed:exitrestart
gateway.twoFactorExitIntervalinteger-Chart configuration parameter
gateway.twoFactorDevicestring-Chart configuration parameter
gateway.reloginAfterTwoFactorTimeoutboolean-Chart configuration parameter
gateway.existingSessionDetectedActionstring-Chart configuration parameter
Allowed:manualprimarysecondaryprimaryoverride
gateway.autoRestartTimestring-Chart configuration parameter
gateway.autoLogoffTimestring-Chart configuration parameter
gateway.coldRestartTimestring-Chart configuration parameter
gateway.saveSettingsAtstring-Chart configuration parameter
gateway.customConfigboolean-Chart configuration parameter

Workload(8)

ParameterTypeDefaultDescription
workload.commandarray-Chart configuration parameter
workload.argsarray-Chart configuration parameter
workload.extraEnvarray-Chart configuration parameter
workload.envFromarray-Chart configuration parameter
workload.extraVolumeMountsarray-Chart configuration parameter
workload.extraVolumesarray-Chart configuration parameter
workload.initContainersarray-Chart configuration parameter
workload.sidecarsarray-Chart configuration parameter

Persistence(7)

ParameterTypeDefaultDescription
persistence.enabledboolean-Chart configuration parameter
persistence.existingClaimstring-Chart configuration parameter
persistence.storageClassstring-Chart configuration parameter
persistence.sizestring-Chart configuration parameter
persistence.accessModesarray-Chart configuration parameter
persistence.retainboolean-Chart configuration parameter
persistence.annotationsobject-Chart configuration parameter

Pod Disruption Budget(1)

ParameterTypeDefaultDescription
podDisruptionBudget.enabledboolean-Chart configuration parameter

Service Account(4)

ParameterTypeDefaultDescription
serviceAccount.createboolean-Chart configuration parameter
serviceAccount.namestring-Chart configuration parameter
serviceAccount.annotationsobject-Chart configuration parameter
serviceAccount.automountServiceAccountTokenboolean-Chart configuration parameter

Service & Networking(7)

ParameterTypeDefaultDescription
service.typestring-Chart configuration parameter
Allowed:ClusterIPNodePortLoadBalancer
service.annotationsobject-Chart configuration parameter
service.livePortinteger-Chart configuration parameter
service.paperPortinteger-Chart configuration parameter
service.ipFamilyPolicystring-Chart configuration parameter
Allowed:SingleStackPreferDualStackRequireDualStack
service.ipFamiliesarray-Chart configuration parameter
service.loadBalancerSourceRangesarray-Chart configuration parameter

Vnc(9)

ParameterTypeDefaultDescription
vnc.enabledboolean-Chart configuration parameter
vnc.existingSecretstring-Chart configuration parameter
vnc.passwordstring-Chart configuration parameter
vnc.passwordKeystring-Chart configuration parameter
vnc.service.typestring-Chart configuration parameter
Allowed:ClusterIPNodePortLoadBalancer
vnc.service.portinteger-Chart configuration parameter
vnc.service.annotationsobject-Chart configuration parameter
vnc.service.ipFamilyPolicystring-Chart configuration parameter
Allowed:SingleStackPreferDualStackRequireDualStack
vnc.service.ipFamiliesarray-Chart configuration parameter

Network Policy(6)

ParameterTypeDefaultDescription
networkPolicy.enabledboolean-Chart configuration parameter
networkPolicy.apiIngressFromarray-Chart configuration parameter
networkPolicy.vncIngressFromarray-Chart configuration parameter
networkPolicy.egressIsolationboolean-Chart configuration parameter
networkPolicy.dnsEgressarray-Chart configuration parameter
networkPolicy.extraEgressarray-Chart configuration parameter

Health Probes(15)

ParameterTypeDefaultDescription
probes.startup.enabledboolean-Chart configuration parameter
probes.startup.commandarray-Chart configuration parameter
probes.startup.periodSecondsinteger-Chart configuration parameter
probes.startup.timeoutSecondsinteger-Chart configuration parameter
probes.startup.failureThresholdinteger-Chart configuration parameter
probes.readiness.enabledboolean-Chart configuration parameter
probes.readiness.commandarray-Chart configuration parameter
probes.readiness.periodSecondsinteger-Chart configuration parameter
probes.readiness.timeoutSecondsinteger-Chart configuration parameter
probes.readiness.failureThresholdinteger-Chart configuration parameter
probes.liveness.enabledboolean-Chart configuration parameter
probes.liveness.commandarray-Chart configuration parameter
probes.liveness.periodSecondsinteger-Chart configuration parameter
probes.liveness.timeoutSecondsinteger-Chart configuration parameter
probes.liveness.failureThresholdinteger-Chart configuration parameter

Termination Grace Period Seconds(1)

ParameterTypeDefaultDescription
terminationGracePeriodSecondsinteger-Chart configuration parameter

Resources(6)

ParameterTypeDefaultDescription
resources.requests.cpustringnumber-Chart configuration parameter
resources.requests.memorystringnumber-Chart configuration parameter
resources.requests.ephemeral-storagestringnumber-Chart configuration parameter
resources.limits.cpustringnumber-Chart configuration parameter
resources.limits.memorystringnumber-Chart configuration parameter
resources.limits.ephemeral-storagestringnumber-Chart configuration parameter

Pod Security(6)

ParameterTypeDefaultDescription
podSecurityContext.runAsNonRootanytrueChart configuration parameter
podSecurityContext.runAsUserinteger-Chart configuration parameter
podSecurityContext.runAsGroupinteger-Chart configuration parameter
podSecurityContext.fsGroupinteger-Chart configuration parameter
podSecurityContext.fsGroupChangePolicyselect-Chart configuration parameter
Allowed:AlwaysOnRootMismatch
podSecurityContext.seccompProfile.typeanyRuntimeDefaultChart configuration parameter

Container Security(3)

ParameterTypeDefaultDescription
securityContext.allowPrivilegeEscalationanyfalseChart configuration parameter
securityContext.readOnlyRootFilesystemboolean-Chart configuration parameter
securityContext.capabilities.droparray-Chart configuration parameter

Node Selector(1)

ParameterTypeDefaultDescription
nodeSelectorobject-Chart configuration parameter

Tolerations(1)

ParameterTypeDefaultDescription
tolerationsarray-Chart configuration parameter

Affinity(1)

ParameterTypeDefaultDescription
affinityobject-Chart configuration parameter

Priority Class Name(1)

ParameterTypeDefaultDescription
priorityClassNamestring-Chart configuration parameter

Topology Spread Constraints(1)

ParameterTypeDefaultDescription
topologySpreadConstraintsarray-Chart configuration parameter

Extra Manifests(1)

ParameterTypeDefaultDescription
extraManifestsarray-Chart configuration parameter