快速开始
在开始之前,请确保满足以下条件:
- TKE 集群(Kubernetes 1.20+)
- 至少 3 个节点(推荐 48C192G)
- kubectl 已配置并可访问集群
- GlobalRouter 网络模式已启用
- CBS 存储类已配置
1. 创建命名空间
Section titled “1. 创建命名空间”kubectl create namespace openclaw2. 配置存储类
Section titled “2. 配置存储类”确保 CBS 存储类已配置:
apiVersion: storage.k8s.io/v1kind: StorageClassmetadata: name: cbs-ssdprovisioner: com.tencent.cloud.csi.cbsparameters: diskType: CLOUD_SSDreclaimPolicy: RetainvolumeBindingMode: WaitForFirstConsumer3. 部署 OpenClaw 实例
Section titled “3. 部署 OpenClaw 实例”apiVersion: apps/v1kind: Deploymentmetadata: name: openclaw-demo namespace: openclawspec: replicas: 1 selector: matchLabels: app: openclaw template: metadata: labels: app: openclaw spec: containers: - name: openclaw image: your-registry/openclaw:latest resources: requests: cpu: "200m" # 0.2C memory: "800Mi" # 800MB limits: cpu: "1" # 1C memory: "2Gi" # 2GB volumeMounts: - name: user-data mountPath: /data volumes: - name: user-data persistentVolumeClaim: claimName: openclaw-demo-pvc4. 创建 PVC
Section titled “4. 创建 PVC”apiVersion: v1kind: PersistentVolumeClaimmetadata: name: openclaw-demo-pvc namespace: openclawspec: accessModes: - ReadWriteOnce storageClassName: cbs-ssd resources: requests: storage: 20Gi5. 验证部署
Section titled “5. 验证部署”# 检查 Pod 状态kubectl get pods -n openclaw
# 查看日志kubectl logs -f deployment/openclaw-demo -n openclaw