apiVersion: apps/v1 kind: Deployment metadata: name: ib-gateway namespace: foxhunt labels: app: ib-gateway app.kubernetes.io/part-of: foxhunt spec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: ib-gateway template: metadata: labels: app: ib-gateway app.kubernetes.io/part-of: foxhunt spec: securityContext: seccompProfile: type: RuntimeDefault imagePullSecrets: - name: gitlab-registry nodeSelector: k8s.scaleway.com/pool-name: platform containers: - name: ib-gateway image: ghcr.io/gnzsnz/ib-gateway:stable securityContext: allowPrivilegeEscalation: false capabilities: drop: ["ALL"] ports: - name: tws-api containerPort: 4002 protocol: TCP - name: tws-api-socat containerPort: 4004 protocol: TCP - name: vnc containerPort: 5900 protocol: TCP env: - name: TWS_USERID valueFrom: secretKeyRef: name: ibkr-credentials key: username - name: TWS_PASSWORD valueFrom: secretKeyRef: name: ibkr-credentials key: password - name: TRADING_MODE value: "paper" - name: TWS_ACCEPT_INCOMING value: "accept" - name: READ_ONLY_API value: "no" - name: TWOFA_TIMEOUT_ACTION value: "restart" - name: EXISTING_SESSION_DETECTED_ACTION value: "primaryoverride" - name: VNC_SERVER_PASSWORD valueFrom: secretKeyRef: name: ibkr-credentials key: vnc-password optional: true resources: requests: memory: "1Gi" cpu: "500m" limits: memory: "2Gi" cpu: "1000m" readinessProbe: tcpSocket: port: 4002 initialDelaySeconds: 90 periodSeconds: 10 livenessProbe: tcpSocket: port: 4002 initialDelaySeconds: 120 periodSeconds: 30 failureThreshold: 5 --- apiVersion: v1 kind: Service metadata: name: ib-gateway namespace: foxhunt labels: app: ib-gateway spec: selector: app: ib-gateway ports: - name: tws-api port: 4002 targetPort: 4002 - name: tws-api-socat port: 4004 targetPort: 4004 - name: vnc port: 5900 targetPort: 5900 type: ClusterIP