Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
A minimal starting point for running OpenClaw on Kubernetes — not a production-ready deployment. It covers the core resources and is meant to be adapted to your environment.
OpenClaw is a single container with some config files. The interesting customization is in agent content (markdown files, skills, config overrides), not infrastructure templating. Kustomize handles overlays without the overhead of a Helm chart. If your deployment grows more complex, a Helm chart can be layered on top of these manifests.
kubectlbash# Replace with your provider: ANTHROPIC, GEMINI, OPENAI, or OPENROUTER export <PROVIDER>_API_KEY="..." ./scripts/k8s/deploy.sh kubectl port-forward svc/openclaw 18789:18789 -n openclaw open http://localhost:18789
Retrieve the configured shared secret for the Control UI. This deploy script creates token auth by default:
bashkubectl get secret openclaw-secrets -n openclaw -o jsonpath='{.data.OPENCLAW_GATEWAY_TOKEN}' | base64 -d
For local debugging,
./scripts/k8s/deploy.sh --show-tokenIf you don't have a cluster, create one locally with Kind:
bash./scripts/k8s/create-kind.sh # auto-detects docker or podman ./scripts/k8s/create-kind.sh --delete # tear down
Then deploy as usual with
./scripts/k8s/deploy.shOption A — API key in environment (one step):
bash# Replace with your provider: ANTHROPIC, GEMINI, OPENAI, or OPENROUTER export <PROVIDER>_API_KEY="..." ./scripts/k8s/deploy.sh
The script creates a Kubernetes Secret with the API key and an auto-generated gateway token, then deploys. If the Secret already exists, it preserves the current gateway token and any provider keys not being changed.
Option B — create the secret separately:
bashexport <PROVIDER>_API_KEY="..." ./scripts/k8s/deploy.sh --create-secret ./scripts/k8s/deploy.sh
Use
--show-tokenbashkubectl port-forward svc/openclaw 18789:18789 -n openclaw open http://localhost:18789
textNamespace: openclaw (configurable via OPENCLAW_NAMESPACE) ├── Deployment/openclaw # Single pod, init container + gateway ├── Service/openclaw # ClusterIP on port 18789 ├── PersistentVolumeClaim # 10Gi for agent state and config ├── ConfigMap/openclaw-config # openclaw.json + AGENTS.md └── Secret/openclaw-secrets # Gateway token + API keys
Edit the
AGENTS.mdscripts/k8s/manifests/configmap.yamlbash./scripts/k8s/deploy.sh
Edit
openclaw.jsonscripts/k8s/manifests/configmap.yamlRe-run with additional keys exported:
bashexport ANTHROPIC_API_KEY="..." export OPENAI_API_KEY="..." ./scripts/k8s/deploy.sh --create-secret ./scripts/k8s/deploy.sh
Existing provider keys stay in the Secret unless you overwrite them.
Or patch the Secret directly:
bashkubectl patch secret openclaw-secrets -n openclaw \ -p '{"stringData":{"<PROVIDER>_API_KEY":"..."}}' kubectl rollout restart deployment/openclaw -n openclaw
bashOPENCLAW_NAMESPACE=my-namespace ./scripts/k8s/deploy.sh
Edit the
imagescripts/k8s/manifests/deployment.yamlyamlimage: ghcr.io/openclaw/openclaw:latest # or pin to a specific version from https://github.com/openclaw/openclaw/releases
The default manifests bind the gateway to loopback inside the pod. That works with
kubectl port-forwardServiceIf you want to expose the gateway through an Ingress or load balancer:
scripts/k8s/manifests/configmap.yamlloopbackbash./scripts/k8s/deploy.sh
This applies all manifests and restarts the pod to pick up any config or secret changes.
bash./scripts/k8s/deploy.sh --delete
This deletes the namespace and all resources in it, including the PVC.
kubectl port-forwardreadOnlyRootFilesystemdrop: ALLkubectl port-forwardhttp://127.0.0.1:18789textscripts/k8s/ ├── deploy.sh # Creates namespace + secret, deploys via kustomize ├── create-kind.sh # Local Kind cluster (auto-detects docker/podman) └── manifests/ ├── kustomization.yaml # Kustomize base ├── configmap.yaml # openclaw.json + AGENTS.md ├── deployment.yaml # Pod spec with security hardening ├── pvc.yaml # 10Gi persistent storage └── service.yaml # ClusterIP on 18789
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine