tool-containers
Menu
GitHub (opens in new tab)

Run T3 Code with Helm

The chart/ installs T3 Code as a Deployment and a ClusterIP Service, both named <release>-t3code.

Images
  • GHCRghcr.io/hambn/t3code
  • Docker Hubdocker.io/hambn/t3code
Use case
Shared cluster instance from a Helm chart
Upstream
github.com/pingdotgg/t3code (opens in new tab)
Source
tools/ai/t3code/docs/helm (opens in new tab)
On this page

Prerequisites

  • Helm 3 and a Kubernetes cluster.

Run T3 Code

Shell
helm install t3code ./chart
kubectl rollout status deploy/t3code-t3code
kubectl logs deploy/t3code-t3code | grep Token:
kubectl port-forward svc/t3code-t3code 3773:3773

Open http://localhost:3773/pair#token=<token> to pair your browser, then sign in to an agent from the UI. The token expires after five minutes; for a new pair URL, run:

Shell
kubectl exec deploy/t3code-t3code -- t3 auth pairing create --base-url http://localhost:3773

Values

Value Default Purpose
image.repository ghcr.io/hambn/t3code Image repository.
image.tag ubuntu-browser Image tag. Set ubuntu-browser@sha256:<digest> to pin one build.
image.pullPolicy Always Pull policy.
service.port 3773 Service port.
resources 100m CPU and 256Mi requested; 2 CPU and 2Gi limit Container resources.

Workspace

/workspace is an emptyDir that is removed with the pod. T3 Code's state and the agent logins reset whenever the container restarts. Edit chart/templates/deployment.yaml to mount persistent volumes.

The Service is cluster-internal. Put an authenticating Ingress in front before you expose it.

Files

Cleanup

Shell
helm uninstall t3code

File contents

chart/Chart.yaml6 lines
apiVersion: v2
name: t3code
description: T3 Code web GUI for coding agents as a Deployment + Service
type: application
version: 0.2.0
appVersion: "0.0.42"
chart/values.yaml15 lines
image:
  repository: ghcr.io/hambn/t3code
  tag: ubuntu-browser
  pullPolicy: Always

service:
  port: 3773

resources:
  requests:
    cpu: 100m
    memory: 256Mi
  limits:
    cpu: "2"
    memory: 2Gi
chart/templates/deployment.yaml60 lines
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-t3code
  labels: { app: {{ .Release.Name }}-t3code }
spec:
  replicas: 1
  selector:
    matchLabels: { app: {{ .Release.Name }}-t3code }
  template:
    metadata:
      labels: { app: {{ .Release.Name }}-t3code }
    spec:
      securityContext:
        runAsNonRoot: true
        runAsUser: 1000
        runAsGroup: 1000
        fsGroup: 1000
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: t3
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop: ["ALL"]
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
          ports:
            - containerPort: 3773
          livenessProbe:
            httpGet:
              path: /
              port: 3773
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /
              port: 3773
            initialDelaySeconds: 5
            periodSeconds: 10
          volumeMounts:
            - name: workspace
              mountPath: /workspace
      volumes:
        - name: workspace
          emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}-t3code
spec:
  selector: { app: {{ .Release.Name }}-t3code }
  ports:
    - port: {{ .Values.service.port }}
      targetPort: 3773

Topics