reloader · 配置热更新控制器
reloader 是这套集群的配置热更新组件:它 watch 集群里的 ConfigMap 与 Secret,当被引用的配置内容变化时,自动给引用它的工作负载(Deployment / DaemonSet / StatefulSet)打补丁触发滚动重启,从而让新配置生效,省去人工 kubectl rollout restart。这对 ExternalSecrets 从 Vault 刷新出来的 Secret 尤其有用——配置变了,Pod 自己就滚了。
applications/infrastructure/reloader/(namespace.yaml + reloader.yaml),由 ArgoCD root-app 同步。本仓库内没有它的 ServiceMonitor / PrometheusRule / HPA / VPA / PDB / Ingress。部署形态
reloader 是单副本的无状态控制器,kustomization 把所有命名空间资源统一落到独立的 reloader namespace(namespace.yaml 创建该 namespace,带 app.kubernetes.io/managed-by: argocd 标签)。
- Name
- 工作负载
- Description
Deploymentreloader-reloader,replicas: 1,revisionHistoryLimit: 2。
- Name
- 镜像
- Description
ghcr.io/stakater/reloader:v1.4.17,imagePullPolicy: IfNotPresent。
- Name
- 命名空间
- Description
reloader(由 kustomization 的namespace: reloader统一覆盖)。
- Name
- 端口
- Description
- 容器端口 9090,名为
http。
- Name
- 调度
- Description
- 无 nodeSelector / workload 标签约束,调度到任意可用节点。
- Name
- 存储
- Description
- 无 PVC,纯内存运行(状态全部来自 watch 的集群对象)。
- Name
- 资源
- Description
- requests
cpu: 10m/memory: 512Mi,limitscpu: 1/memory: 512Mi。
- Name
- 安全上下文
- Description
runAsNonRoot: true,runAsUser: 65534(nobody),seccompProfile: RuntimeDefault。
配置与依赖
reloader 没有 ConfigMap,也没有 ExternalSecret,运行参数全部走容器 env 与命令行默认值。它通过自身 ServiceAccount reloader-reloader 拿到集群级权限来完成监听与重启。
- Name
- GOMAXPROCS / GOMEMLIMIT
- Description
- 用
resourceFieldRef分别取limits.cpu/limits.memory,让 Go runtime 的并行度与内存上限对齐容器 limits。
- Name
- RELOADER_NAMESPACE
- Description
- 取
metadata.namespace(即reloader),用于 leader election 等本命名空间操作。
- Name
- RELOADER_DEPLOYMENT_NAME
- Description
- 固定为
reloader-reloader。
RBAC 分两层:ClusterRole reloader-reloader-role 给集群范围内 list/get/watch secrets、configmaps,update/patch apps 与 extensions 下的 deployments/daemonsets/statefulsets,list/get cronjobs、增删 jobs,以及 create/patch events;命名空间级的 Role reloader-reloader-metadata-role 在 reloader namespace 内对 configmaps 有 list/get/watch/create/update(用于自身元数据 / leader election)。两个 binding 都指向 ServiceAccount reloader-reloader。
访问与监控
reloader 没有 Service / Ingress,仅在 Pod 内暴露 9090 端口供探针访问,不对外。监控埋点也在该端口上:
- Name
- livenessProbe
- Description
httpGet /live(porthttp),initialDelaySeconds: 10,periodSeconds: 10,failureThreshold: 5,timeoutSeconds: 5。
- Name
- readinessProbe
- Description
httpGet /metrics(porthttp),同样 10s 延迟 / 10s 周期 / 5 次阈值 —— 就绪探针直接打 Prometheus metrics 端点。
本仓库未为 reloader 配置 ServiceMonitor / PrometheusRule,因此 9090 上的 /metrics 当前没有被采集;如需纳入监控需另加 ServiceMonitor。也没有 HPA / VPA / PDB —— 单副本无状态控制器,按需自愈即可。
返回 infrastructure 总览