Files
Deploy-Laboratory/docs/05-09-openclaw-web-小游戏网页平台.md
2026-03-27 16:58:41 +08:00

51 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 05-09-openclaw-web 小游戏网页平台
> 在 K3s 中部署一个简单的 OpenClaw Web 前端(示例 Deployment/Service/Ingress用于演示“静态站点/前端应用通过 Traefik 暴露”这一类场景。
## TL;DR
- **自动化验收**`./scripts/verify.sh run 05-09`
- **关键前置**:按本文「前置条件」准备环境变量/Secret/入口 IP
- **成功判据**:达到本文「预期」且 playbook 断言通过
- **排障**:见本文「排障」
## 前置条件
- 已完成基础集群安装:`01-01``01-02`
- Traefik 入口可用(参考 `03-01-k3s-traefik-dashboard.md`
- 你已准备好可拉取的前端镜像(示例使用 `ghcr.io/your/openclaw-web:latest`,请按环境替换)
## 清单路径(唯一真源)
| 项 | 路径 |
|----|------|
| 本篇清单 | [`ansible/files/05-09/openclaw-web.yml`](../ansible/files/05-09/openclaw-web.yml) |
| 应用 | `kubectl apply -f ansible/files/05-09/openclaw-web.yml` |
| 删除 | `kubectl delete -f ansible/files/05-09/openclaw-web.yml` |
## 部署与验证
```bash
kubectl apply -f ansible/files/05-09/openclaw-web.yml
kubectl get deploy,svc,ing -n default | grep -i openclaw-web
curl -I --max-time 5 http://openclaw.example.com/
```
预期:
- `openclaw-web` Deployment 处于 `Available`
- Ingress 生效后,通过域名可访问到前端(`200` 或静态站点常见的重定向均可接受)
## 失败排查
- **404**:域名/Host 未解析到集群入口 IP或 Ingress `host` 不一致。
- **502**Service 无 EndpointsPod 未 Ready 或 selector 不匹配)。
- **ImagePullBackOff**:镜像仓库不可达或未配置鉴权。
## 排障
- **先看 playbook 输出**:失败时先定位是 deploy/wait/http_check 哪一步。
- **集群侧总览**`kubectl get nodes -o wide``kubectl -n kube-system get pods -o wide`
- **事件与日志**`kubectl -n <ns> describe ...``kubectl -n <ns> logs ... --tail=200`