Deploying OpenCode¶
OpenCode is an AI coding assistant similar to Claude Code. The opencode runtime is installed by the language-operator-runtimes chart.
Prerequisites¶
- Language Operator installed, including the
language-operator-runtimeschart (provides theopencoderuntime) - A
LanguageClusterto deploy into, with yourkubectlcontext set to its namespace (examples below assume a cluster nameddemo-cluster) - An LLM provider API key, or a local model endpoint (e.g. Ollama)
Instructions¶
Configure a Model¶
kubectl create secret generic anthropic-credentials \
--from-literal=api-key=sk-ant-your-key-here
kubectl apply -f - <<EOF
apiVersion: langop.io/v1alpha1
kind: LanguageModel
metadata:
name: claude-sonnet
spec:
provider: anthropic
modelName: claude-sonnet-4-5
apiKeySecretRef:
name: anthropic-credentials
key: api-key
EOF
Deploy OpenCode¶
Verify¶
Wait for the pod to reach Running and the LanguageAgent to show Ready=True.
Connect¶
Access is gated by the cluster's OIDC proxy — there is no separate opencode password.
If your LanguageCluster has a domain and auth enabled,
open https://opencode.demo-cluster.\<your-domain> and sign in through the cluster's OIDC provider.
For local access, port-forward the service (this bypasses the proxy, so no login is required):
kubectl port-forward svc/opencode 3000:3000
# open http://localhost:3000, or attach the TUI:
opencode attach http://localhost:3000
Warning
opencode has no built-in authentication. When the cluster does not enable auth, opencode is exposed unauthenticated on its ingress. Enable cluster auth to protect it.
What the Operator Created¶
| Resource | Name | Purpose |
|---|---|---|
| Deployment | opencode |
Runs the OpenCode container |
| Service | opencode |
ClusterIP on port 3000 |
| NetworkPolicy | opencode |
Allows inbound from other agents in this namespace |
| PVC | opencode-workspace |
10Gi persistent workspace |
| ConfigMap | opencode-agent |
Injected at /etc/agent/config.yaml |