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:
@@ -23,7 +23,7 @@
|
||||
|
||||
## 完整配置(与 Ansible 共用)
|
||||
|
||||
配置位于 `ansible/files/nginx-matrix/`(4 个文件对应 M1~M4),文档与 Ansible 共用此目录:
|
||||
配置位于 `ansible/files/02-05-nginx-matrix/`(4 个文件对应 M1~M4),文档与 Ansible 共用此目录:
|
||||
|
||||
| 文件 | 场景 | 路径 | 节点 |
|
||||
|------|------|------|------|
|
||||
@@ -37,7 +37,7 @@
|
||||
## 部署
|
||||
|
||||
```bash
|
||||
kubectl apply -f ansible/files/nginx-matrix/ -R
|
||||
kubectl apply -f ansible/files/02-05-nginx-matrix/ -R
|
||||
kubectl get pod,svc,ing,ingressroute -n default -o wide
|
||||
```
|
||||
|
||||
@@ -110,10 +110,10 @@ Manifest 里四份写法一致,若只有 M1 仍显示默认页,多半是集
|
||||
|
||||
```bash
|
||||
# 在仓库根目录执行时:
|
||||
kubectl apply -f ansible/files/nginx-matrix/ -R
|
||||
kubectl apply -f ansible/files/02-05-nginx-matrix/ -R
|
||||
|
||||
# 若当前在 ansible/ 目录下,改用:
|
||||
kubectl apply -f files/nginx-matrix/ -R
|
||||
kubectl apply -f files/02-05-nginx-matrix/ -R
|
||||
```
|
||||
|
||||
**M1 未生效时:删除部署再重新部署(推荐)**
|
||||
@@ -125,10 +125,10 @@ kubectl apply -f files/nginx-matrix/ -R
|
||||
kubectl delete deployment nginx-m1 -n default
|
||||
|
||||
# 2. 重新部署 M1(在 ansible/ 目录下)
|
||||
kubectl apply -f files/nginx-matrix/01-control-ingress.yaml
|
||||
kubectl apply -f files/02-05-nginx-matrix/01-control-ingress.yaml
|
||||
|
||||
# 若在仓库根目录:
|
||||
# kubectl apply -f ansible/files/nginx-matrix/01-control-ingress.yaml
|
||||
# kubectl apply -f ansible/files/02-05-nginx-matrix/01-control-ingress.yaml
|
||||
|
||||
# 3. 等 Pod Running 后验证
|
||||
kubectl get pod -n default -l app=nginx-m1
|
||||
@@ -143,7 +143,7 @@ kubectl exec -n default deployment/nginx-m1 -- cat /etc/nginx/conf.d/default.con
|
||||
可使用 Ansible playbook 自动完成复制 manifests、apply、等待 Pod 就绪及 curl 验证:
|
||||
|
||||
- **Playbook**:`ansible/playbooks/nginx-matrix-deploy.yml`
|
||||
- **Manifests 位置**:`ansible/files/nginx-matrix/`(M1 control-plane / M2 M4 节点名 ylc61、ylc64,M3 worker;按实际修改 M2/M4 节点名)
|
||||
- **Manifests 位置**:`ansible/files/02-05-nginx-matrix/`(M1 control-plane / M2 M4 节点名 ylc61、ylc64,M3 worker;按实际修改 M2/M4 节点名)
|
||||
- **执行(在 ansible/ 目录下)**:
|
||||
|
||||
```bash
|
||||
@@ -164,14 +164,14 @@ Playbook 会:拷贝 manifests 到控制节点 → **先删除全部 nginx 矩
|
||||
**手动 kubectl apply 的**:用同一目录删除
|
||||
|
||||
```bash
|
||||
kubectl delete -f ansible/files/nginx-matrix/ -R
|
||||
kubectl delete -f ansible/files/02-05-nginx-matrix/ -R
|
||||
```
|
||||
|
||||
**Ansible playbook 部署的**:在仓库根或 ansible 同级的机器上,用 manifests 删除(需配置 KUBECONFIG)
|
||||
|
||||
```bash
|
||||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml # 或从控制节点拷贝 kubeconfig
|
||||
kubectl delete -f ansible/files/nginx-matrix/ -R
|
||||
kubectl delete -f ansible/files/02-05-nginx-matrix/ -R
|
||||
```
|
||||
|
||||
若控制节点上 `/tmp/nginx-matrix/` 仍存在,也可在控制节点执行:
|
||||
|
||||
Reference in New Issue
Block a user