apiVersion: apps/v1 kind: Deployment metadata: name: agents-user-{{user_id}} namespace: {{namespace}} labels: app: agents user: {{user_id}} spec: replicas: 1 selector: matchLabels: app: agents user: {{user_id}} template: metadata: labels: app: agents user: {{user_id}} spec: containers: - name: agent image: {{image}} env: - name: NODE_ENV value: production - name: OPENCLAW_GATEWAY_TOKEN value: {{gateway_token}} - name: OPENCLAW_GATEWAY_SVC value: agents-user-{{user_id}} - name: TZ value: Asia/Shanghai - name: NODE_OPTIONS value: "--max-old-space-size=4096" - name: WANMEI_USER_ID value: {{user_id}} - name: QWEN_PORTAL_API_KEY value: {{qwen_api_key}} ports: - containerPort: 18789 resources: limits: cpu: {{cpu_limit}} memory: {{mem_limit}} requests: cpu: {{cpu_request}} memory: {{mem_request}} volumeMounts: - name: volume-config mountPath: /data/config - name: data mountPath: /home/node/.openclaw volumes: - name: volume-config configMap: name: openclaw - name: data persistentVolumeClaim: claimName: agents-user-{{user_id}} imagePullSecrets: - name: {{image_pull_secret}} --- apiVersion: v1 kind: Service metadata: name: agents-user-{{user_id}} namespace: {{namespace}} spec: selector: app: agents user: {{user_id}} ports: - name: http port: 80 targetPort: 18789 - name: gateway port: 18789 targetPort: 18789 type: ClusterIP