stubbi/openclaw-operator
Kubernetes operator for deploying and managing OpenClaw AI agent instances with production-grade security, observability, and lifecycle management.
What is this?
OpenClaw Kubernetes Operator is a tool that lets you run OpenClaw AI agents on your own Kubernetes cluster. OpenClaw is an AI agent platform that can act on your behalf across messaging apps (Telegram, Discord, WhatsApp, Signal), manage your inbox, calendar, smart home, and more via 50+ integrations. The operator automates the complex setup of running these agents in Kubernetes, handling security, storage, monitoring, and updates for you.
Why do you need it?
Running an AI agent in Kubernetes isn't just a simple deployment. You need network isolation, secret management, persistent storage, health checks, optional browser automation, and config rollouts — all wired correctly. The operator packages all of that into a single OpenClawInstance resource. You define what you want in a YAML file, and the operator creates and manages all the underlying Kubernetes resources (StatefulSet, Service, NetworkPolicy, PVC, etc.) automatically.
Key Features
- Declarative: One custom resource defines the entire stack — no manual wiring.
- Self-configuring agents: Agents can autonomously install skills, change config, add environment variables, or seed workspace files — but only if you enable it and only within an allowlist you define.
- Secure by default: Runs as non-root, read-only filesystem, drops all capabilities, uses default seccomp, default-deny network policy, and a validating webhook.
- Observable: Built-in Prometheus metrics, ServiceMonitor integration, structured JSON logging, and Kubernetes events.
- Flexible: Works with any AI provider (Anthropic, OpenAI, etc.) via environment variables or config files.
- Config modes: Choose between overwriting config on restart or deep-merging with existing config (preserving runtime changes).
- Skills & plugins: Declaratively install skills (from ClawHub, npm, or GitHub) and plugins via init containers.
- Auto-update: Optionally watch for new versions, back up before updating, and auto-rollback if health checks fail.
- Scalable: Horizontal Pod Autoscaler integration with CPU/memory metrics.
- Suspension: Scale to zero with
spec.suspended: true. - Self-healing: PodDisruptionBudgets, health probes, config rollouts via content hashing, and drift detection.
- Disk-aware readiness: Optional guard that checks if the workspace disk is full or read-only before marking a pod ready.
- Backup/restore: Automatic S3-compatible backups on deletion, before updates, and on a schedule.
- Workspace seeding: Pre-populate the workspace with files/directories.
- Gateway auth: Auto-generated tokens for gateway authentication.
- Tailscale: Expose via Tailscale Serve/Funnel with SSO.
- Extensible: Add sidecars (Chromium for browser automation, Ollama for local LLMs, Tailscale) and custom init containers.
- Cloud-native: Support for AWS IRSA / GCP Workload Identity and CA bundle injection.
- Cluster defaults: A singleton
OpenClawClusterDefaultsresource can fill in unset fields for all instances (useful for air-gapped regions). - Zombie reaping: Shares PID namespace so the pause container reaps defunct processes.
How it works
You create an OpenClawInstance custom resource (CR) with your desired configuration. The operator watches for changes to these CRs and reconciles the actual state of the cluster to match. It creates and manages all the required Kubernetes resources (StatefulSet, Service, RBAC, NetworkPolicy, PVC, etc.).
Agents can also modify their own environment via OpenClawSelfConfig CRs, but only if you enable selfConfigure and only for allowed actions (skills, config, env vars, workspace files). Every request is validated against the allowlist.
Quick Start
Install the operator (using Helm):
helm install openclaw-operator oci://ghcr.io/paperclipinc/charts/openclaw-operator --namespace openclaw-operator-system --create-namespaceCreate a secret with your API keys (e.g.,
ANTHROPIC_API_KEY).Deploy an instance with a simple YAML:
apiVersion: openclaw.rocks/v1alpha1 kind: OpenClawInstance metadata: name: my-agent spec: envFrom: - secretRef: name: openclaw-api-keys storage: persistence: enabled: true size: 10GiApply it with
kubectl apply -f ....Verify with
kubectl get openclawinstancesandkubectl get pods.
The operator handles the rest — creating the StatefulSet, services, security policies, and more.
Notes
- Requires Kubernetes 1.28+ and Helm 3.
- The operator can be restricted to specific namespaces (instead of cluster-wide) via
watchNamespaces. - You can bring your own RBAC if needed.
- The README includes many advanced configuration options (gateway proxy, Chromium sidecar, disk-aware readiness, etc.) — see the full README for details.
This explainer is based solely on the README provided. For full details, refer to the original project documentation.
Related
- Project
- Project
- Project
- Project
- Project