You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Best practices
Deploying OpenClaw by using VCI
Copy page
Download PDF
Deploying OpenClaw by using VCI
This topic describes how to deploy the OpenClaw service by using VCI.​
warning​
  • Currently, the VCI service is not available to individual users. Therefore, the content of this topic applies only to Volcano Engine users who pass enterprise authentication. For information about enterprise authentication, see Real name authentication.​
  • This content is used to help you get started with deploying the OpenClaw service and is not recommended for direct use in production environments.​
Background​
OpenClaw introduction​
OpenClaw (formerly known as Clawdbot and Moltbot) is a globally popular open-source AI agent execution gateway. It is not an LLM, but the orchestration layer and execution hub for LLMs. Connecting to mainstream LLMs at the upper level and digital systems and physical hardware at the lower level, it upgrades AI from passive dialogue mode to a fully closed-loop autonomous agent that follows the cycle of "Understand → Plan → Execute → Feedback". With a single natural language instruction, it can accomplish real-world tasks across multiple scenarios.​
Industry requirements​
The behaviors of OpenClaw, such as code generation, command execution, and browser operations, are uncertain. Combined with security risks such as prompt injection, the lack of a comprehensive security protection system can easily lead to business risks. In addition, new infrastructure requirements arise in enterprise-grade scenarios: efficient orchestration of thousands of sandbox environments and rapid creation and destruction of sandboxes. This ensures the whole network access process is controllable and compliant.​
Advantages of Kubernetes and VCI​
Kubernetes is the de facto standard for cloud-native application orchestration. It provides mature scalability and network capabilities. However, AI Agents introduce a new running mode. They are isolated and stateful singleton workloads, which require persistent identity, secure code execution staging areas, and life cycle management that supports suspension and rapid restoration. AI Agents are idle most of the time with occasional bursts of activity.​
As a serverless and containerized computing service, VCI can be seamlessly integrated with VKE, which provides Kubernetes orchestration capabilities. VCI provides the following advantages in the OpenClaw deployment scenario:​
  • Multi-tenant isolated deployment: Achieves virtual machine-level strong isolation through Kata Container. When used together with network security groups, RBAC, and resource quotas, it achieves permissions, resources, and data boundary management across multiple tenants and sessions.​
  • Execution security protection: Provides sandboxes with the minimum permissions for system-level operations of AI Agents, such as code execution, file operations, API calls, and browser automation. It blocks the escape of attackers and unauthorized operations by using seccomp, AppArmor, read-only mount, and system call restrictions.​
  • Elastic task scheduling: Provides standardized image packaging and sandbox execution environments for modular skill units. Leveraging Kubernetes elastic scaling, self-healing, and on-demand start/stop capabilities, it adapts to high-concurrency and burst task scenarios.​
Solution architecture introduction​
​​​
The overall architecture of OpenClaw deployed through VCI is divided into two layers: the control plane and the data plane.​
  • Control plane: The control plane uses kube-apiserver as its central hub and integrates two controllers that correspond to two deployment modes.​
  • Kubernetes native controller: Applicable to the Deployment deployment mode. The kube controller manager uses the List&Watch mechanism to monitor native resources (such as Deployment and ReplicaSet) in the kube-apiserver, and creates Pods and manages Pods throughout the entire lifecycle by following the standard Kubernetes workflow.​
  • Agent Sandbox controller: Applicable to the Sandbox deployment mode. The Agent Sandbox Controller uses the List&Watch mechanism to listen to the Sandbox custom resource definition (CRD) in the kube-apiserver, and is mainly used to manage Sandboxes throughout the entire lifecycle and restore snapshots.​
  • Data plane: The data plane is used for running and isolating workloads and provides high availability across availability zones (AZs).​
Deploy OpenClaw from scratch​
This section describes how to deploy the OpenClaw service by using Volcano Engine VCI. The following content introduces the preparation phase and two specific deployment methods. You can select an appropriate deployment method based on your business requirements:​
  • Deployment-based deployment: Suitable for stateless scenarios, or scenarios where state persistence is achieved through data volumes.​
  • Agent Sandbox-based deployment: Suitable for scenarios where stateful operation is required, such as personal assistants or AI Agents. This method provides advanced features, such as state persistence, warm pools, and image commit.​
Preparation phase​
Before starting the deployment, you need to complete all configurations in the preparation phase.​
Step 1: Prepare a Kubernetes cluster​
Prepare a VKE cluster to integrate and manage computing, storage, networking, and other resources for the deployment of the OpenClaw service. You can use an existing cluster or create a cluster. You can use an existing cluster or create a cluster.​
​
Use existing clusters
Create clusters
​
To deploy the OpenClaw service by using VCI in an existing VKE cluster, make sure that the cluster meets the following conditions:​
  • The public access feature has been enabled, which ensures that nodes in the cluster can access the public network. You can view whether NAT gateway is available and enabled on the Overview tab of the cluster Overview page. If it is available, the public access feature is enabled. Otherwise, it is disabled, and you need to manually enable it. For detailed operations, see How do I manually enable Public NAT for Internet endpoint for a cluster?​
  • ​​​
  • The vci-virtual-kubelet add-on has been installed in the cluster, which allows the cluster to deploy applications by using VCI. For details, see Installing add-ons.​
  • The csi-ebs add-on has been installed in the cluster for storage mounting. For details, see Installing add-ons.​
​
Step 2: Prepare the deployment script​
The following content takes downloading the official OpenClaw deployment script locally as an example. You can also use a machine that can run kubectl commands in the cloud or on an on-premises computer to prepare the deployment script.​
  1. (Optional) Download and install the latest version of the kubectl tool from the official Kubernetes website on your on-premises computer. If the kubectl tool is already installed in your local terminal, you can skip this step.​
  1. In the local terminal, download the official OpenClaw deployment script.​
  • ​
    git clone https://github.com/openclaw/openclaw.git​
    ​
  • The expected response is as follows:​
  • ​
    Cloning into 'openclaw'...​
    remote: Enumerating objects: 418856, done.​
    remote: Counting objects: 100% (9/9), done.​
    remote: Compressing objects: 100% (9/9), done.​
    remote: Total 418856 (delta 0), reused 1 (delta 0), pack-reused 418847 (from 1)​
    Receiving objects: 100% (418856/418856), 468.48 MiB | 9.48 MiB/s, done.​
    Resolving deltas: 100% (272988/272988), done.​
    Updating files: 100% (14132/14132), done.​
    ​
  1. Go to the deployment script path and check whether the download is complete.​
  • ​
    cd openclaw/scripts/k8s && ls -l​
    ​
  • The expected response is as follows:​
  • ​
    total 40​
    -rwxr-xr-x 1 bytedance staff 6823 4 16 10:42 create-kind.sh​
    -rwxr-xr-x 1 bytedance staff 8589 4 16 10:42 deploy.sh​
    drwxr-xr-x 7 bytedance staff 224 4 16 10:42 manifests​
    ​
Step 3: Prepare a large model​
Prepare the metadata of the large model that you plan to use, including the model name, API address, and API Key. Enter the model information in the corresponding configuration file based on the deployment method that you select, including Deployment-based or Agent Sandbox-based deployment. The following content uses the Doubao model in ModelArk as an example.​
tip​
When you use a self-managed OpenClaw assistant, OpenClaw allows you to directly view and edit LLM provider configurations (including API Keys) by default, which poses a risk of credential leakage. We recommend that platform providers (B-side) manage the mapping relationships among end users (C-side), VCI instances, and API Keys through an independent gateway or proxy layer. This prevents the actual API Key from being exposed to end users.​
​
"models": {​
"mode": "merge",​
"providers": {​
"ark": {​
"baseUrl": "https://ark.cn-beijing.volces.com/api/v3", // The model API endpoint.​
"apiKey": "********", // The credential for requesting the model service.​
"api": "openai-completions", // The fixed value, which is an API agreement provided by OpenAI.​
"models": [​
{​
"id": "doubao-seed-2-0-pro-260215", // The model ID.​
"name": "doubao-seed-2-0-pro-260215", // The model name.​
"reasoning": false,​
"input": [​
"text"​
],​
...​
​
The following table describes the providers.ark parameter related to the model in the configuration file.​
​
Parameter​
Description​
baseUrl​
The model API endpoint. For the Base URL that corresponds to the Volcano Engine ModelArk model, see Base URL and authentication.​
apiKey​
The credential for requesting the model service. You can go to the API keys page to create your Volcano Engine ModelArk API Key, or use an existing API Key.​
api​
Fixed value: openai-completions. The openai-completions is an API protocol provided by OpenAI and has become the de facto standard in the field of LLM applications.​
models.id​
The ID and name of the Doubao model. You can use the following method to obtain them.​
  1. Go to the Model activation page to activate the Doubao model service.​
  1. On the Doubao model details page, obtain the model ID and model name.​
tip​
You can specify a custom model name. We recommend keeping the name consistent with the console name or model ID to facilitate subsequent identification.​
models.name​
​
​
Step 4: Prepare images​
Two images, including busybox:1.37 and ghcr.io/openclaw/openclaw:slim are used for deploying OpenClaw. Due to network restrictions in the Chinese mainland, please download these two images to your on-premises computer first, and then upload them to your internal image registry (such as CR of Volcano Engine). In this way, the images can be stably pulled during deployment.​
warning​
  • OpenClaw is updated frequently. The OpenClaw image version used in this topic is v2026.3.12, which is for testing and reference only. We do not recommend using the version in production environments for the long term.​
  • After preparing images, replace the image address with the address of your internal registry in the YAML file subsequently.​
Step 5: Prepare a Feishu bot​
You need to create a Larkbot to interact with the OpenClaw service. ​
  1. Create an enterprise self-managed application.​
  1. Log in to the Feishu Open Platform, and click Create Custom App.​
  1. Configure the name, description, and icon of the application.​
  1. Click Create to complete the operation.​
  1. Add the bot capability.​
  1. In the left navigation pane, click Features > Add Features.​
  1. Click the By Feature tab, and click Add on the Bot card.​
  1. Configure permissions.​
  1. In the left navigation pane, click Development Configuration > Permissions & Scopes. Then, click Batch import/export scopes.​
  1. On the Import tab, replace the original example with the following permissions, and click Next, Review New Scopes.​
  • ​
    {​
    "scopes": {​
    "tenant": [​
    "contact:contact.base:readonly",​
    "docx:document:readonly",​
    "im:chat:read",​
    "im:chat:update",​
    "im:message.group_at_msg:readonly",​
    "im:message.p2p_msg:readonly",​
    "im:message.pins:read",​
    "im:message.pins:write_only",​
    "im:message.reactions:read",​
    "im:message.reactions:write_only",​
    "im:message:readonly",​
    "im:message:recall",​
    "im:message:send_as_bot",​
    "im:message:send_multi_users",​
    "im:message:send_sys_msg",​
    "im:message:update",​
    "im:resource",​
    "application:application:self_manage",​
    "cardkit:card:write",​
    "cardkit:card:read"​
    ],​
    "user": [​
    "contact:user.employee_id:readonly",​
    "offline_access",​
    "base:app:copy",​
    "base:field:create",​
    "base:field:delete",​
    "base:field:read",​
    "base:field:update",​
    "base:record:create",​
    "base:record:delete",​
    "base:record:retrieve",​
    "base:record:update",​
    "base:table:create",​
    "base:table:delete",​
    "base:table:read",​
    "base:table:update",​
    "base:view:read",​
    "base:view:write_only",​
    "base:app:create",​
    "base:app:update",​
    "base:app:read",​
    "board:whiteboard:node:create",​
    "board:whiteboard:node:read",​
    "calendar:calendar:read",​
    "calendar:calendar.event:create",​
    "calendar:calendar.event:delete",​
    "calendar:calendar.event:read",​
    "calendar:calendar.event:reply",​
    "calendar:calendar.event:update",​
    "calendar:calendar.free_busy:read",​
    "contact:contact.base:readonly",​
    "contact:user.base:readonly",​
    "contact:user:search",​
    "docs:document.comment:create",​
    "docs:document.comment:read",​
    "docs:document.comment:update",​
    "docs:document.media:download",​
    "docs:document:copy",​
    "docx:document:create",​
    "docx:document:readonly",​
    "docx:document:write_only",​
    "drive:drive.metadata:readonly",​
    "drive:file:download",​
    "drive:file:upload",​
    "im:chat.members:read",​
    "im:chat:read",​
    "im:message",​
    "im:message.group_msg:get_as_user",​
    "im:message.p2p_msg:get_as_user",​
    "im:message:readonly",​
    "search:docs:read",​
    "search:message",​
    "space:document:delete",​
    "space:document:move",​
    "space:document:retrieve",​
    "task:comment:read",​
    "task:comment:write",​
    "task:task:read",​
    "task:task:write",​
    "task:task:writeonly",​
    "task:tasklist:read",​
    "task:tasklist:write",​
    "wiki:node:copy",​
    "wiki:node:create",​
    "wiki:node:move",​
    "wiki:node:read",​
    "wiki:node:retrieve",​
    "wiki:space:read",​
    "wiki:space:retrieve",​
    "wiki:space:write_only"​
    ]​
    }​
    }​
    ​
  1. After confirming the permissions are correct in the pop-up window, click Add.​
tip​
For the specific meaning of the relevant permissions, see Feishu API permission list.​
  1. Click Configure to set the scope of accessible data on which the permissions are granted. In this topic, set the scope to the same as the available scope of the application.​
  1. Click Confirm.​
  1. Obtain configuration information.​
  1. In the left navigation pane, click Basic Info > Credentials & Basic Info.​
  1. In the Credentials section, obtain and record the App ID and App Secret information.​
tip​
The obtained App ID and App Secret will be used to configure the OpenClaw service. Keep them confidential.​
  1. Release the application.​
  1. Click Create Version at the top of the page.​
  1. Configure the version number, default capability, update description, and other information of the application as needed. Click here to learn more.​
  1. Click Save at the bottom of the page to create the version.​
  1. Click Publish in the upper-right corner of the page to release the application.​
Deployment-based deployment​
This deployment method applies to stateless operation scenarios or scenarios where state persistence is achieved through data volumes. After the Pod is deleted, all runtime data will be cleaned up.​
Step 1: Modify the configuration file of Openclaw​
  1. In the local terminal where the Openclaw deployment script is downloaded, execute the following command to access the manifests folder.​
  • ​
    cd openclaw/scripts/k8s/manifests​
    ​
  1. Modify the kustomization.yaml file. VCI Pods are deployed through the system volume. They do not require additional PVC storage. Therefore, remove pvc.yaml from the resources field of the kustomization.yaml file.​
  • ​​​
  • ​
    Directly delete through the command line
    Delete by editing the file
    ​
    You can use the following command to directly delete pvc.yaml from the resources field:​
    • macOS terminal​
    • ​
      sed -i '' '/- pvc.yaml/d' kustomization.yaml​
      ​
    • Windows/Linux terminal​
    • ​
      sed -i '/- pvc.yaml/d' kustomization.yaml​
      ​
    ​
  1. Modify the content of the openclaw.json field in the configmap.yaml file by mainly adding the following configurations:​
  • models: Configure the large models you need, such as the Doubao model.​
  • plugins: Enable the Feishu add-on.​
  • channels: Configure the information required for communication with Larkbot.​
  • ​
    {​
    "gateway": {​
    "mode": "local",​
    "bind": "loopback",​
    "port": 18789,​
    "auth": {​
    "mode": "token"​
    },​
    "controlUi": {​
    "enabled": true​
    }​
    },​
    "models": {​
    "mode": "merge",​
    "providers": {​
    "ark": {​
    "baseUrl": "https://ark.cn-beijing.volces.com/api/v3", // The model API endpoint.​
    "apiKey": "********", // The API Key of Volcano Engine ModelArk.​
    "api": "openai-completions",​
    "models": [​
    {​
    "id": "doubao-seed-2-0-pro-260215", // The model ID.​
    "name": "doubao-seed-2-0-pro-260215", // The model name.​
    "reasoning": false,​
    "input": [​
    "text"​
    ],​
    "cost": {​
    "input": 0,​
    "output": 0,​
    "cacheRead": 0,​
    "cacheWrite": 0​
    },​
    "contextWindow": 200000,​
    "maxTokens": 8192,​
    "compat": {​
    "supportsDeveloperRole": false​
    }​
    }​
    ]​
    }​
    }​
    },​
    "agents": {​
    "defaults": {​
    "model": {​
    "primary": "ark/doubao-seed-2-0-pro-260215" // The Agent main model (default model).​
    },​
    "models": { // The list of available Agent models.​
    "ark/doubao-seed-2-0-pro-260215": {}​
    },​
    "workspace": "~/.openclaw/workspace", // The Agent workspace, which is the physical storage path at the underlying runtime of the Pod.​
    "compaction": {​
    "mode": "safeguard"​
    },​
    "maxConcurrent": 4,​
    "subagents": {​
    "maxConcurrent": 8​
    }​
    }​
    },​
    "cron": {​
    "enabled": false​
    },​
    "plugins": {​
    "entries": {​
    "feishu": {​
    "enabled": true​
    }​
    }​
    },​
    "channels": {​
    "feishu": {​
    "enabled": true,​
    "appId": "cli_a9207****", // The App ID of the Larkbot.​
    "appSecret": "∗∗∗∗∗∗∗∗", // The App Secret of the Larkbot.​
    "connectionMode": "websocket",​
    "domain": "feishu",​
    "dmPolicy": "pairing",​
    "groupPolicy": "open"​
    }​
    }​
    }​
    ​
  • After you configure the content of the openclaw.json field, the complete sample content of the configmap.yaml file is as follows:​
  • ​
    apiVersion: v1​
    kind: ConfigMap​
    metadata:​
    name: openclaw-config​
    labels:​
    app: openclaw​
    data:​
    openclaw.json: |​
    {​
    "gateway": {​
    "mode": "local",​
    "bind": "loopback",​
    "port": 18789,​
    "auth": {​
    "mode": "token"​
    },​
    "controlUi": {​
    "enabled": true​
    }​
    },​
    "models": {​
    "mode": "merge",​
    "providers": {​
    "ark": {​
    "baseUrl": "https://ark.cn-beijing.volces.com/api/v3",​
    "apiKey": "40c4c8b2-aed******",​
    "api": "openai-completions",​
    "models": [​
    {​
    "id": "doubao-seed-2-0-pro-260215",​
    "name": "doubao-seed-2-0-pro",​
    "reasoning": false,​
    "input": [​
    "text"​
    ],​
    "cost": {​
    "input": 0,​
    "output": 0,​
    "cacheRead": 0,​
    "cacheWrite": 0​
    },​
    "contextWindow": 200000,​
    "maxTokens": 8192,​
    "compat": {​
    "supportsDeveloperRole": false​
    }​
    }​
    ]​
    }​
    }​
    },​
    "agents": {​
    "defaults": {​
    "model": {​
    "primary": "ark/doubao-seed-2-0-pro-260215"​
    },​
    "models": {​
    "ark/doubao-seed-2-0-pro-260215": {}​
    },​
    "workspace": "~/.openclaw/workspace",​
    "compaction": {​
    "mode": "safeguard"​
    },​
    "maxConcurrent": 4,​
    "subagents": {​
    "maxConcurrent": 8​
    }​
    },​
    "list": [​
    {​
    "id": "default",​
    "name": "OpenClaw Assistant",​
    "workspace": "~/.openclaw/workspace"​
    }​
    ]​
    },​
    "cron": {​
    "enabled": false​
    },​
    "plugins": {​
    "entries": {​
    "feishu": {​
    "enabled": true​
    }​
    }​
    },​
    "channels": {​
    "feishu": {​
    "enabled": true,​
    "appId": "cli_a9207****",​
    "appSecret": "ho3ftd****",​
    "connectionMode": "websocket",​
    "domain": "feishu",​
    "dmPolicy": "pairing",​
    "groupPolicy": "open"​
    }​
    }​
    }​
    ​
Step 2: Run the workload​
  1. Modify the deployment.yaml file to adapt it for VCI deployment. The main modifications are as follows:​
  • Add an annotation: Use the vke.volcengine.com/burst-to-vci: enforce annotation to forcibly schedule the Pod to VCI.​
  • Adjust the Init container: VCI does not support fsGroup. Therefore, to ensure that the main container runs as user 1000, you need to modify the owner of the working directory in the Init container.​
  • Adjust main container commands: When the main container starts, it first copies the configuration file from the path prepared by the Init container to the working directory, and then starts OpenClaw.​
  • The configuration of the sample deployment.yaml file is as follows:​
  • ​
    apiVersion: apps/v1​
    kind: Deployment​
    metadata:​
    name: openclaw​
    labels:​
    app: openclaw​
    spec:​
    replicas: 1​
    selector:​
    matchLabels:​
    app: openclaw​
    strategy:​
    type: Recreate​
    template:​
    metadata:​
    annotations:​
    vke.volcengine.com/burst-to-vci: enforce # Forced scheduling to VCI.​
    labels:​
    app: openclaw​
    spec:​
    automountServiceAccountToken: false​
    securityContext:​
    seccompProfile:​
    type: RuntimeDefault​
    initContainers:​
    - name: init-config​
    image: your-private-registry/busybox:1.37 # The address and version of the container image. Replace the value with your actual information.​
    imagePullPolicy: IfNotPresent​
    command:​
    - sh​
    - -c​
    - |​
    cp /config/openclaw.json /home/node/.openclawconfig/openclaw.json​
    mkdir -p /home/node/.openclawconfig/workspace​
    cp /config/AGENTS.md /home/node/.openclawconfig/workspace/AGENTS.md​
    chown -R 1000:1000 /home/node/.openclawconfig​
    securityContext:​
    runAsUser: 0​
    resources:​
    requests:​
    memory: 32Mi​
    cpu: 50m​
    limits:​
    memory: 64Mi​
    cpu: 100m​
    volumeMounts:​
    - name: openclaw-home​
    mountPath: /home/node/.openclawconfig​
    - name: config​
    mountPath: /config​
    containers:​
    - name: gateway​
    image: your-private-registry/openclaw:slim # The address and version of the container image. Replace the value with your actual information.​
    imagePullPolicy: IfNotPresent​
    command:​
    - sh​
    - -c​
    - |​
    mkdir /home/node/.openclaw​
    cp -r /home/node/.openclawconfig/* /home/node/.openclaw​
    node /app/dist/index.js gateway run​
    ports:​
    - name: gateway​
    containerPort: 18789​
    protocol: TCP​
    env:​
    - name: HOME​
    value: /home/node​
    - name: OPENCLAW_CONFIG_DIR​
    value: /home/node/.openclaw​
    - name: NODE_ENV​
    value: production​
    - name: OPENCLAW_GATEWAY_TOKEN​
    valueFrom:​
    secretKeyRef:​
    name: openclaw-secrets​
    key: OPENCLAW_GATEWAY_TOKEN​
    resources:​
    requests:​
    memory: 4Gi​
    cpu: "2"​
    limits:​
    memory: 4Gi​
    cpu: "2"​
    livenessProbe:​
    exec:​
    command:​
    - node​
    - -e​
    - "require('http').get('http://127.0.0.1:18789/healthz', r => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))"​
    initialDelaySeconds: 60​
    periodSeconds: 30​
    timeoutSeconds: 10​
    readinessProbe:​
    exec:​
    command:​
    - node​
    - -e​
    - "require('http').get('http://127.0.0.1:18789/readyz', r => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))"​
    initialDelaySeconds: 15​
    periodSeconds: 10​
    timeoutSeconds: 5​
    volumeMounts:​
    - name: openclaw-home​
    mountPath: /home/node/.openclawconfig​
    - name: tmp-volume​
    mountPath: /tmp​
    securityContext:​
    runAsNonRoot: true​
    runAsUser: 1000​
    runAsGroup: 1000​
    allowPrivilegeEscalation: false​
    readOnlyRootFilesystem: true​
    capabilities:​
    drop:​
    - ALL​
    volumes:​
    - name: openclaw-home​
    emptyDir: {} ​
    - name: config​
    configMap:​
    name: openclaw-config​
    - name: tmp-volume​
    emptyDir: {}​
    ​
  1. Run the deployment script command.​
  • ​
    export OPENAI_API_KEY=NOT_NEEDED && ./deploy.sh​
    ​
  • The expected response is as follows:​
  • ​​​
  1. After the command is executed, you can view the installation result under the openclaw namespace on the Workload > Deployment page of the target cluster in the VKE console.​
Step 3: Configure the OpenClaw Feishu AI assistant​
  1. Log in to the Feishu Open Platform.​
  1. Click the Enterprise self-managed application tab, and click the Feishu open app you created.​
  1. In the left navigation pane, click Development configuration > Event and callback.​
  • ​
    Event configuration
    Callback configuration
    ​
    1. Click the Event configuration tab and click the edit icon next to Subscription method.​
    1. Select Use persistent connection to receive event and click Save.​
    1. In the Added events section, click Add event.​
    1. In the Add event dialog box, click the App identity subscription tab, search for Message, and then select three events, including Receive message, Message reacted, and Message reaction cancelled. Then, click Confirm.​
    1. (Optional) To add the bot to a chat group for use, obtain the permissions to obtain group messages. Otherwise, skip this step.​
    warning​
    OpenClaw is a personal AI assistant. Using it in a chat group may pose risks, such as credential leakage. Use it with caution.​
    1. In the Added events section, click View other permissions in the Required permissions column that corresponds to the Receive message event.​
    1. Click Obtain all messages in the group (sensitive permission).​
    1. In the pop-up window, click Activate permission to apply for the permissions.​
    ​
  1. Create a robot version and release it.​
  1. Click Create version at the top of the page.​
  1. Configure the version number, default capability, update description, and other information of the application as needed. Click here to learn more.​
  1. Click Save at the bottom of the page to create the version.​
  1. Click Confirm release in the upper-right corner of the page to release the application.​
Step 4: Verify the service​
  1. Pair with the Feishu application.​
  1. Send a message to the bot, such as hello.​
  1. Obtain the pairing code replied by the bot.​
  • ​​​
  1. Log in to the OpenClaw Pod created in Step 2: Run the workload.​
  • ​
    Log in via the console
    Log in via the Kubectl command line
    ​
    1. In the VKE console, go to the details page of the target cluster and click Workload > Deployment. Find the created VCI Deployment under the openclaw namespace.​
    1. In the upper-right corner of the Deployment details page, click Console to log in to the Pod.​
    • ​​​
    ​
  1. Execute the pairing command by using the pairing code returned by the bot.​
  • ​
    openclaw pairing approve feishu BKRAE44L --notify​
    ​
  • The expected response is as follows:​
  • ​​​
  1. After pairing is successful, the bot will send a confirmation message. At this point, you can start interacting with the OpenClaw assistant.​
Agent Sandbox-based deployment​
VCI Agent Sandbox integrates the Agent Sandbox CRD of the community with the cloud product capabilities of Volcano Engine. It is specifically designed for managing code execution environments for AI Agents, providing advanced features, such as strong isolation, state persistence, and cold start optimization. This deployment method applies to scenarios where each user or session requires an independent, stateful runtime environment.​
Considerations​
Take note of the Agent Sandbox-related considerations before deploying the OpenClaw service by using Agent Sandbox. For details, see Considerations for VCI Agent Sandbox.​
Step 1: Install the Agent Sandbox controller​
You need to install the Agent Sandbox controller in the cluster first. You can perform a custom installation. For detailed operations, see Installation guide.​
Step 2: Create a sandbox​
After the controller is installed, you can define and start a sandbox instance by creating a CR instance of the sandbox type.​
  1. Before creating a sandbox, create a StorageClass in the VKE cluster for dynamically creating PVCs for sandbox data volumes.​
  • ​​​
  1. Write the Sandbox YAML file.​
  • The content of the sample sandbox.yaml file for deploying OpenClaw is as follows. This file defines a sandbox instance, which runs as a VCI Pod and has data persistence capability.​
tip​
For parameters with annotations, modify the parameter values based on your business requirements.​
  • ​
    apiVersion: agents.x-k8s.io/v1alpha1​
    kind: Sandbox​
    metadata:​
    annotations:​
    agent.sandbox.io/snapshot-deletion-policy: delete​
    agent.sandbox.io/snapshot-retention-days: "3"​
    name: openclaw-sandbox # The sandbox name, which is also the name of the Pod that corresponds to the sandbox.​
    namespace: openclaw # The namespace to which the sandbox belongs.​
    spec:​
    replicas: 1 # The number of replicas for the sandbox. You can set the value only to 0 (suspend) or 1 (start).​
    volumeClaimTemplates:​
    - spec: ​
    accessModes:​
    - ReadWriteMany​
    resources:​
    requests:​
    storage: 20Gi​
    storageClassName: test-storage-class # The StorageClass name, which is used for dynamically creating a PVC for the sandbox data volume.​
    volumeMode: Filesystem​
    metadata:​
    name: generated-name​
    podTemplate: # The VCI Pod template that corresponds to the sandbox.​
    metadata:​
    annotations:​
    vci.volcengine.com/tls-enable: "false" # Specify whether to enable log collection. Valid values: true (enable) and false (disable).​
    vke.volcengine.com/burst-to-vci: enforce # Forced scheduling to VCI.​
    vci.vke.volcengine.com/enable-auto-create-imc: "true" # Enable automatic image caching.​
    vci.volcengine.com/usable-disk-capacity: "40" # Specify the available space of the system volume (writable layer space).​
    vci.volcengine.com/persistent-container: "true" # Specify whether to enable persistence for the container writable layer data. Valid values: true (enable) and false (disable).​
    labels:​
    app: test-server ​
    spec:​
    automountServiceAccountToken: false​
    securityContext:​
    seccompProfile:​
    type: RuntimeDefault​
    initContainers:​
    - name: init-config​
    image: helm-cr-cn-shanghai.cr.volces.com/e2e-test-images/busybox:2.32​
    imagePullPolicy: IfNotPresent​
    command:​
    - sh​
    - -c​
    - |​
    cp /config/openclaw.json /home/node/.openclawconfig/openclaw.json​
    mkdir -p /home/node/.openclawconfig/workspace​
    cp /config/AGENTS.md /home/node/.openclawconfig/workspace/AGENTS.md​
    chown -R 1000:1000 /home/node/.openclawconfig​
    securityContext:​
    runAsUser: 0​
    resources:​
    requests:​
    memory: 32Mi​
    cpu: 50m​
    limits:​
    memory: 64Mi​
    cpu: 100m​
    volumeMounts:​
    - name: openclaw-home​
    mountPath: /home/node/.openclawconfig​
    - name: config​
    mountPath: /config​
    containers:​
    - name: gateway​
    image: helm-cr-cn-shanghai.cr.volces.com/openclaw/openclaw:slim​
    imagePullPolicy: IfNotPresent​
    command:​
    - sh​
    - -c​
    - |​
    mkdir /home/node/.openclaw​
    cp -r /home/node/.openclawconfig/* /home/node/.openclaw​
    node /app/dist/index.js gateway run​
    ports:​
    - name: gateway​
    containerPort: 18789​
    protocol: TCP​
    env:​
    - name: HOME​
    value: /home/node​
    - name: OPENCLAW_CONFIG_DIR​
    value: /home/node/.openclaw​
    - name: NODE_ENV​
    value: production​
    - name: OPENCLAW_GATEWAY_TOKEN​
    valueFrom:​
    secretKeyRef:​
    name: openclaw-secrets​
    key: OPENCLAW_GATEWAY_TOKEN​
    - name: ANTHROPIC_API_KEY​
    valueFrom:​
    secretKeyRef:​
    name: openclaw-secrets​
    key: ANTHROPIC_API_KEY​
    optional: true​
    - name: OPENAI_API_KEY​
    valueFrom:​
    secretKeyRef:​
    name: openclaw-secrets​
    key: OPENAI_API_KEY​
    optional: true​
    - name: GEMINI_API_KEY​
    valueFrom:​
    secretKeyRef:​
    name: openclaw-secrets​
    key: GEMINI_API_KEY​
    optional: true​
    - name: OPENROUTER_API_KEY​
    valueFrom:​
    secretKeyRef:​
    name: openclaw-secrets​
    key: OPENROUTER_API_KEY​
    optional: true​
    resources:​
    requests:​
    memory: 4Gi​
    cpu: "2"​
    limits:​
    memory: 4Gi​
    cpu: "2"​
    livenessProbe:​
    exec:​
    command:​
    - node​
    - -e​
    - "require('http').get('http://127.0.0.1:18789/healthz', r => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))"​
    initialDelaySeconds: 60​
    periodSeconds: 30​
    timeoutSeconds: 10​
    readinessProbe:​
    exec:​
    command:​
    - node​
    - -e​
    - "require('http').get('http://127.0.0.1:18789/readyz', r => process.exit(r.statusCode < 400 ? 0 : 1)).on('error', () => process.exit(1))"​
    initialDelaySeconds: 15​
    periodSeconds: 10​
    timeoutSeconds: 5​
    volumeMounts:​
    - name: openclaw-home​
    mountPath: /home/node/.openclawconfig​
    - name: tmp-volume​
    mountPath: /tmp​
    securityContext:​
    runAsNonRoot: true​
    runAsUser: 1000​
    runAsGroup: 1000​
    allowPrivilegeEscalation: false​
    readOnlyRootFilesystem: true​
    capabilities:​
    drop:​
    - ALL​
    volumes:​
    - name: openclaw-home​
    emptyDir: {} ​
    - name: config​
    configMap:​
    name: openclaw-config​
    - name: tmp-volume​
    emptyDir: {}​
    ​
  1. Run the following command to create the sandbox.​
  • ​
    kubectl apply -f sandbox.yaml​
    ​
  1. View the result of sandbox creation.​
  1. In the VKE console, go to the details page of the target cluster. Click Workload > Resource Explorer in the left navigation pane. Find the CRD resource named sandbox, click its name to go to the details page, and then view the sandbox details.​
  1. In the List of resources section, find the target resource. In the Actions column, click ... > Edit Yaml to view the status.phase field in the custom resource YAML file. If the value is Running, the sandbox is created.​
  • ​
    status:​
    conditions:​
    - lastTransitionTime: "2026-03-26T03:46:01Z"​
    message: Pod is Ready; Service Exists​
    observedGeneration: 5​
    reason: DependenciesReady​
    status: "True"​
    type: Ready​
    instanceId: vci-xxxxxxx​
    phase: Running # The current status of the sandbox resource.​
    recentPodUID: 3fb2e674-4025-4106-8cec-032ea5c045c6​
    replicas: 1 ​
    selector: agents.x-k8s.io/sandbox-name-hash=62f96e10​
    service: openclaw-sandbox​
    serviceFQDN: openclaw-sandbox.openclaw.svc.cluster.local​
    snapShotId: fake-id​
    snapShotStatus: Completed​
    ​
  1. Simulate temporary data generated during sandbox runtime.​
  1. In the VKE console, go to the details page of the target cluster and click Workload > Pod. Find the Pod that corresponds to the sandbox created under the openclaw namespace.​
  1. Click the Pod name to go to its details page. Click Console in the upper-right corner of the page to log in to the container of the Pod, and create the openclaw_test.md file under /app to simulate temporary data generated during sandbox runtime.​
  • ​​​
Step 3: Suspend and restore the sandbox​
One of the core features of Agent Sandbox is the ability to suspend and restore, which saves computing resources when idle. In the OpenClaw business, you can train your OpenClaw assistant by suspending and restoring the sandbox. For more information about suspending and restoring the sandbox, see Managing sandbox lifecycles.​
​
Suspending a sandbox
Restoring a sandbox
​
  1. Modify spec.replicas in the sandbox.yaml file to 0 to suspend the sandbox. When you suspend the sandbox, a snapshot will be automatically generated, and VCI resources will be released and stop incurring fees, but their metadata will be retained. The sample code snippet is as follows:​
  • ​
    apiVersion: agents.x-k8s.io/v1alpha1​
    kind: Sandbox​
    metadata:​
    annotations:​
    agent.sandbox.io/snapshot-deletion-policy: delete​
    agent.sandbox.io/snapshot-retention-days: "3"​
    name: openclaw-sandbox​
    namespace: openclaw​
    spec:​
    replicas: 0 # The number of replicas for the sandbox. You can set the value only to 0 (suspend) or 1 (start).​
    ​
  • If the status.phase of the CRD changes to Paused, it indicates that the sandbox has been suspended. The sample code snippet is as follows:​
  • ​
    status:​
    conditions:​
    - lastTransitionTime: "2026-02-05T06:24:40Z"​
    message: Pod does not exist, replicas is 0; Service Exists​
    observedGeneration: 2​
    reason: DependenciesReady​
    status: "True"​
    type: Ready​
    phase: Paused # The current status of the sandbox resource.​
    replicas: 0​
    service: test-sandbox-example​
    serviceFQDN: test-sandbox-example.default.svc.cluster.local​
    snapShotId: fake-id # Record the snapshot ID at shutdown, which will be used when the sandbox is started again.​
    ​
  1. After you suspend the sandbox, the generated snapshot sandboxsnapshot can be viewed on the Workload > Resource Explorer page of the target cluster in the VKE console.​
  1. Click sandboxsnapshot to go to the Resource Explorer details page and view detailed snapshot information.​
  • If specific resources are displayed under the list of resources, it indicates that the snapshot has been created.​
  • In the list of resources, find the resource that corresponds to the snapshot. In the Actions column, click ... > Edit Yaml to view the status.phase of the snapshot CRD. If the value is Completed, it indicates that the snapshot has been created.​
  • ​
    status:​
    conditions:​
    - lastTransitionTime: "2026-03-26T07:53:52Z"​
    message: snapshot is created​
    reason: SnapShotCreated​
    status: "True"​
    type: Ready​
    phase: Completed # The current status of the sandbox resource.​
    sizeBytes: 40​
    snapshotId: snap-3wzwq1****​
    ​
​
Step 4: Verify the deployment result​
Run the openclaw tui command in the local terminal to view the deployment result. The expected response is as follows. You can directly interact with the OpenClaw assistant by using the command-line tool.​
​​​
tip​
You can also follow the Feishu configuration method described in the Deployment-based deployment section to configure the OpenClaw assistant that is deployed through Agent Sandbox as a Larkbot.​
Last updated: 2026.07.24 16:18:07