feat: 按 doc_id 重组 ansible/files 与验证框架

- ansible/files 改为与文档 XX-YY 对齐的目录结构,更新相关 playbook 路径
- 新增 scripts/verify.sh 与 ansible/playbooks/verify/*.yml,移除单体 verify-matrix.yml
- 补充 docs/00-02 矩阵状态、00-05 验证框架与流程、00-04 环境与 ylc65 工作机说明
- 增加 k3s 存储准备、Longhorn、local-path 等 playbook 与辅助脚本

Made-with: Cursor
This commit is contained in:
2026-03-26 07:01:14 +08:00
parent a67788de56
commit 8c43761962
192 changed files with 4006 additions and 320 deletions

View File

@@ -34,7 +34,12 @@ kubectl -n kube-system get configmap local-path-config -o yaml > /tmp/local-path
kubectl -n kube-system edit configmap local-path-config
```
配置结构示意(请与现有 JSON 合并,不要盲目整段覆盖)
**本仓库实验室真源**(四节点 **10G+32G**、K3s `--data-dir=/storage` 统一拓扑):[`ansible/files/03-05-local-path-config/local-path-config-lab.json`](../ansible/files/03-05-local-path-config/local-path-config-lab.json) —— 仅含 **`DEFAULT_PATH_FOR_NON_LISTED_NODES``/storage/storage`**。应用方式
- Ansible`ansible-playbook -i inventory.ini playbooks/apply-local-path-config-lab.yml`,或在 `group_vars/all.yml``longhorn_apply_local_path_lab: true` 后执行 `longhorn-install.yml`(见 `01-06``03-07`)。
- 手工:备份后编辑 ConfigMap`config.json` 与真源 JSON 对齐,再 `rollout restart` provisioner。
配置结构示意(**四节点统一基路径**时只需 `DEFAULT` 一条;请与现有 JSON 合并,不要盲目整段覆盖):
```json
{
@@ -42,10 +47,6 @@ kubectl -n kube-system edit configmap local-path-config
{
"node": "DEFAULT_PATH_FOR_NON_LISTED_NODES",
"paths": ["/storage/storage"]
},
{
"node": "ylc61",
"paths": ["/data/k3s-local-path"]
}
]
}
@@ -54,9 +55,8 @@ kubectl -n kube-system edit configmap local-path-config
说明:
- `DEFAULT_PATH_FOR_NON_LISTED_NODES` 是兜底规则,不是实际节点名;凡是未单独列出的节点都走它。
- `ylc61` 单独覆盖规则;该节点会优先使用这里配置的基路径
- `paths` 是数组是因为支持“一个节点多个候选基路径”;示例里每个节点只写了一个路径。
- 因此这段不是“一个节点两个路径”,而是“两个节点规则(默认 + 指定)”。
- **仅当**集群里仍存在「部分节点系统盘小、部分节点有大盘」等**混合规格**时,才需要再增加按节点名的条目(例如为某主机名单独指定另一基路径);实验室四节点同拓扑时**不要**再为 `ylc61` 单独写小盘路径,以免与 `00-04` 基线冲突
- `paths` 是数组是因为支持“一个节点多个候选基路径”;上例每个规则只写了一个路径。
```bash
# 3. 重启 provisioner 使配置生效
@@ -65,12 +65,12 @@ kubectl -n kube-system rollout restart deploy/local-path-provisioner 2>/dev/null
### 3) 用 demo 验证PVC -> PV -> 节点 -> 落地目录)
Demo 清单:[`ansible/files/local-path-demo/local-path-pvc-demo.yaml`](../ansible/files/local-path-demo/local-path-pvc-demo.yaml)
Demo 清单:[`ansible/files/03-05-local-path-demo/local-path-pvc-demo.yaml`](../ansible/files/03-05-local-path-demo/local-path-pvc-demo.yaml)
> 该 demo 已包含 `nodeSelector` 固定节点(示例为 `ylc61`),使用前请按你的节点主机名修改。
```bash
kubectl apply -f ansible/files/local-path-demo/local-path-pvc-demo.yaml
kubectl apply -f ansible/files/03-05-local-path-demo/local-path-pvc-demo.yaml
kubectl rollout status deploy/nginx-local-pvc-demo --timeout=180s
```