chore: 清理调试脚本并收敛到 Ansible 流程

移除已废弃的调试/验证脚本与空目录,统一文档与脚本说明到 ansible-playbook 的部署方式,避免失效引用和误用路径。

Made-with: Cursor
This commit is contained in:
2026-03-23 19:18:55 +08:00
parent 8a54cac61f
commit be97836e0d
92 changed files with 3463 additions and 4855 deletions

View File

@@ -1,74 +1,74 @@
# docs/05-08-openclaw-k3s-实验部署.md — 实验用;替换镜像与域名
apiVersion: v1
kind: Namespace
metadata:
name: openclaw
apiVersion: v1 # Namespace 使用的核心 API 版本
kind: Namespace # 资源类型:命名空间
metadata: # Namespace 元信息
name: openclaw # 命名空间名称
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: openclaw-gateway
namespace: openclaw
spec:
replicas: 1
selector:
matchLabels:
app: openclaw-gateway
template:
metadata:
labels:
app: openclaw-gateway
spec:
containers:
- name: openclaw-gateway
image: registry.local/openclaw:local
imagePullPolicy: IfNotPresent
env:
- name: OPENCLAW_GATEWAY_MODE
value: "local"
ports:
- containerPort: 18789
volumeMounts:
- name: config
mountPath: /home/node/.openclaw
- name: workspace
mountPath: /home/node/.openclaw/workspace
volumes:
- name: config
emptyDir: {}
- name: workspace
emptyDir: {}
apiVersion: apps/v1 # Deployment 使用的 API 版本
kind: Deployment # 工作负载Deployment
metadata: # Deployment 元信息
name: openclaw-gateway # Deployment 名称
namespace: openclaw # 所在命名空间
spec: # Deployment 规格
replicas: 1 # 副本数
selector: # 选择器
matchLabels: # 标签匹配
app: openclaw-gateway # 匹配标签 app=openclaw-gateway
template: # Pod 模板
metadata: # Pod 元信息
labels: # Pod 标签
app: openclaw-gateway # 与 selector 匹配
spec: # Pod 规格
containers: # 容器列表
- name: openclaw-gateway # 容器名
image: registry.local/openclaw:local # 容器镜像(按环境替换)
imagePullPolicy: IfNotPresent # 拉取策略:本地有镜像则不重复拉取
env: # 环境变量
- name: OPENCLAW_GATEWAY_MODE # 运行模式变量名
value: "local" # 运行模式值
ports: # 容器端口
- containerPort: 18789 # 网关监听端口
volumeMounts: # 卷挂载
- name: config # 配置卷
mountPath: /home/node/.openclaw # 配置目录挂载点
- name: workspace # 工作目录卷
mountPath: /home/node/.openclaw/workspace # 工作目录挂载点
volumes: # 卷定义
- name: config # 配置卷名
emptyDir: {} # 临时卷Pod 生命周期内)
- name: workspace # 工作目录卷名
emptyDir: {} # 临时卷Pod 生命周期内)
---
apiVersion: v1
kind: Service
metadata:
name: openclaw-gateway
namespace: openclaw
spec:
selector:
app: openclaw-gateway
ports:
- port: 18789
targetPort: 18789
protocol: TCP
name: http
apiVersion: v1 # Service 使用的核心 API 版本
kind: Service # Service 资源
metadata: # Service 元信息
name: openclaw-gateway # Service 名称
namespace: openclaw # 命名空间
spec: # Service 规格
selector: # 后端 Pod 选择器
app: openclaw-gateway # 选择 app=openclaw-gateway 的 Pod
ports: # 端口映射列表
- port: 18789 # Service 暴露端口
targetPort: 18789 # 转发到容器端口
protocol: TCP # 协议
name: http # 端口名
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: openclaw-gateway
namespace: openclaw
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
rules:
- host: openclaw-k3s.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: openclaw-gateway
port:
number: 18789
apiVersion: networking.k8s.io/v1 # Ingress API 版本
kind: Ingress # 入口路由资源
metadata: # Ingress 元信息
name: openclaw-gateway # Ingress 名称
namespace: openclaw # 命名空间
annotations: # 控制器注解
traefik.ingress.kubernetes.io/router.entrypoints: web # 使用 Traefik web(HTTP) 入口
spec: # Ingress 规则
rules: # 规则列表
- host: openclaw-k3s.example.com # 访问域名(按环境修改)
http: # HTTP 规则
paths: # 路径列表
- path: / # 根路径
pathType: Prefix # 前缀匹配
backend: # 后端目标
service: # 后端 Service
name: openclaw-gateway # Service 名称
port: # Service 端口
number: 18789 # 端口号