openclaw 部署

This commit is contained in:
Sense T
2026-05-11 01:08:15 +00:00
parent 89e615bd92
commit a20188d2ae
7 changed files with 448 additions and 0 deletions
+83
View File
@@ -0,0 +1,83 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: openclaw
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: openclaw
template:
metadata:
labels:
app: openclaw
spec:
volumes:
- name: data
hostPath:
path: /data/openclaw
- name: tools
hostPath:
path: /data/openclaw/tools
- name: projects
hostPath:
path: /data/code-server/coder
type: DirectoryOrCreate
- name: tmp
emptyDir: {}
containers:
- name: openclaw
# ghcr.io/openclaw/openclaw:2026.5.7-slim
image: openclaw-image
env:
- name: PATH
value: /home/node/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
resources:
limits:
memory: "4Gi"
cpu: "2"
requests:
memory: "128Mi"
cpu: "500m"
command:
- node
- /app/dist/index.js
- gateway
- run
volumeMounts:
- mountPath: /home/node/.openclaw
name: data
- mountPath: /home/node/.openclaw/workspace/Projects
name: projects
- mountPath: /home/node/.local
name: tools
- mountPath: /tmp
name: tmp
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
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
+11
View File
@@ -0,0 +1,11 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
kind: Kustomization
namespace: openclaw
resources:
- deployment.yaml
- services.yaml
images:
- name: openclaw-image
newName: cr.wetofu.me/ghcr.io/openclaw/openclaw
newTag: 2026.5.7-slim
+10
View File
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: openclaw
spec:
selector:
app: openclaw
ports:
- port: 8080
targetPort: 18789
+240
View File
@@ -0,0 +1,240 @@
[
{
"name": "loadts",
"value": "1778460006675",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809996006,
"storeId": null
},
{
"name": "xsecappid",
"value": "xhs-pc-web",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809996006,
"storeId": null
},
{
"name": "acw_tc",
"value": "0a00d76417784600042951338e0a8044a3f47a592b92ed6c1cfbd9f926c0ff",
"domain": "www.xiaohongshu.com",
"hostOnly": true,
"path": "/",
"secure": false,
"httpOnly": true,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1778461804.859,
"storeId": null
},
{
"name": "websectiga",
"value": "cffd9dcea65962b05ab048ac76962acee933d26157113bb223105a116241fa6c",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1778719207,
"storeId": null
},
{
"name": "x-rednote-datactry",
"value": "CN",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": true,
"httpOnly": true,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957743.891,
"storeId": null
},
{
"name": "webBuild",
"value": "6.9.1",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": true,
"firstPartyDomain": "",
"partitionKey": null,
"storeId": null
},
{
"name": "sec_poison_id",
"value": "fca0c925-ed61-494b-9763-29fb27bd66ab",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1778460612,
"storeId": null
},
{
"name": "web_session",
"value": "040069b01e8e125ba06687c735384b31930288",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": true,
"httpOnly": true,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957743.891,
"storeId": null
},
{
"name": "gid",
"value": "yjdyJq8yddKdyjdyJq8yylkWSyUqJM7D2kDVCqSVVfT79E48v1hWU78884WjY8y8YWyW2000",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1813020010.592,
"storeId": null
},
{
"name": "a1",
"value": "19e123011c1p32sub5gbjjjdkutylv7p6oxwug73c40000479801",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957600,
"storeId": null
},
{
"name": "abRequestId",
"value": "14b9d6ff-6adc-5bf5-aad0-2e2817697bbe",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957596.934,
"storeId": null
},
{
"name": "ets",
"value": "1778421600674",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1781013600.674,
"storeId": null
},
{
"name": "id_token",
"value": "VjEAAPk4gK2wvkooDZ9BYhE9sPPzpw/gK3AAQ1C6wyfixKrt2cfVJewgDEXgXG9Xxw69LILQZPn0U0X4k7FR4uL5Q01Jqq7dQtPS2WRZIGi1i3RnSeKM5FxG/ChXt95ypt8/tAdk",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": true,
"httpOnly": true,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957743.891,
"storeId": null
},
{
"name": "unread",
"value": "{%22ub%22:%2269f86a6d000000002202578f%22%2C%22ue%22:%226a00846f000000003802364f%22%2C%22uc%22:25}",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": true,
"firstPartyDomain": "",
"partitionKey": null,
"storeId": null
},
{
"name": "webId",
"value": "6e87f8205933bfa03f238baadb820e01",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": false,
"httpOnly": false,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957600,
"storeId": null
},
{
"name": "x-rednote-holderctry",
"value": "CN",
"domain": ".xiaohongshu.com",
"hostOnly": false,
"path": "/",
"secure": true,
"httpOnly": true,
"sameSite": null,
"session": false,
"firstPartyDomain": "",
"partitionKey": null,
"expirationDate": 1809957743.891,
"storeId": null
}
]
+76
View File
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: xiaohongshu-mcp
labels:
app: xiaohongshu-mcp
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: xiaohongshu-mcp
template:
metadata:
labels:
app: xiaohongshu-mcp
spec:
# Docker Compose 中 init: true 的等效设置
shareProcessNamespace: false
# 国内镜像源(阿里云)
# imagePullSecrets:
# - name: aliyun-regcred
containers:
- name: xhs-mcp
# Docker Hub 镜像
image: image
# 国内用户可换阿里云镜像(需要先拉取到本地仓库)
# image: crpi-hocnvtkomt7w9v8t.cn-beijing.personal.cr.aliyuncs.com/xpzouying/xiaohongshu-mcp
ports:
- containerPort: 18060
protocol: TCP
env:
- name: ROD_BROWSER_BIN
value: /usr/bin/google-chrome
- name: COOKIES_PATH
value: /app/data/cookies.json
volumeMounts:
- name: cookies
mountPath: /app/data/cookies.json
subPath: cookies.json
- name: data
mountPath: /app/data
- name: images
mountPath: /app/images
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "1Gi"
cpu: "500m"
# Chrome 在容器内需要 --no-sandbox 等参数
# 项目 rod 默认会处理,这里加安全上下文确保 Chrome 能跑
securityContext:
allowPrivilegeEscalation: false
capabilities:
add: ["SYS_ADMIN"]
seccompProfile:
type: Unconfined
# Chrome 需要一些额外的系统调用权限
runAsNonRoot: false
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "killall -TERM chrome || true"]
volumes:
- name: cookies
configMap:
name: xhs-cookies
- name: data
hostPath:
type: DirectoryOrCreate
path: /data/xiaohongshu-mcp
- name: images
emptyDir: {}
+15
View File
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://json.schemastore.org/kustomization.json
kind: Kustomization
namespace: openclaw
resources:
- deployment.yaml
- service.yaml
images:
- name: image
newName: cr.wetofu.me/xpzouying/xiaohongshu-mcp
newTag: v1.2.4
configMapGenerator:
- name: xhs-cookies
files:
- cookies.json
+13
View File
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: xiaohongshu-mcp
spec:
type: ClusterIP
ports:
- port: 18060
targetPort: 18060
protocol: TCP
name: mcp-http
selector:
app: xiaohongshu-mcp