Sandbox 集群
这里是 OpenSandbox、CI 和 AI Agent workload 所在双节点 k3s 集群的 Flux
reconciliation 入口。LXC、PostgreSQL、K3s、固定版本的 Flux controllers 与 root
sync 由 infrastructure/sandbox-cluster/ 中的 Ansible 管理;本目录只组合集群内
workload。
Flux 通过 https://git.ddupan.top/panxiao81/homelab-infra.git 读取公开仓库。
Ansible 将 homelab CA 注入 GitRepository/flux-system 引用的同名 Secret,不使用
长期 Git 凭据。root Kustomization 从 ./clusters/sandbox 开始 reconciliation,
初始保持 prune: false。
Root bootstrap 已完成。后续按依赖顺序分别引入:
- 监控 CRD、kube-state-metrics 以及 kubelet/cAdvisor 抓取配置;
- SPIRE Agent、SPIFFE CSI Driver 与 workload registration;
- Kata Containers、
block-plainRuntimeClass; - OpenSandbox operator/server 及
ci-pod、ci-vmPools。
每一阶段单独合并并等待对应 Flux Kustomization Ready,不在 bootstrap 时一次性部署。
第一阶段监控拆为 monitoring-operator 与依赖它的 monitoring,防止 VM CR 在
VictoriaMetrics Operator CRD Ready 前进入 reconciliation。
SPIRE 阶段先由 spire-bootstrap 安装 CRD,并声明只允许 tokenreviews.create 的
central Server reviewer。Agent ServiceAccount 留给后续 HelmRelease 创建,避免两个
声明方争夺同一资源。随后运行
infrastructure/sandbox-cluster/ansible/spire-bootstrap.yml:playbook 从 sandbox
读取 reviewer token,在内存中组成受限 kubeconfig,再通过 stdin reconcile 到 central
集群的 spire-server/spire-external-kubeconfigs Secret。凭据不写入仓库、日志或控制机
文件;该 Secret 准备完成后,才能启用 central external PSAT/controller-manager 和
sandbox Agent/CSI。
监控边界
这里只管理 sandbox LXC 内的 Kubernetes 监控,不负责 PVE 宿主监控。LXC 与宿主共享
内核,即使 lxcfs 虚拟化了内存和 uptime,容器内 /proc/stat 仍是宿主 CPU 视图;
在 LXC 内运行 node_exporter 会生成混合语义并重复采集宿主指标,因此禁止部署。
Sandbox 节点与 workload 指标来自 kubelet/cAdvisor 和 kube-state-metrics;K3s 或 LXC 特有但上述接口未覆盖的指标,应使用目标明确的 collector,不以 node_exporter 补齐。