Files
mixingx.hub.chart/release-charts/mixingx-gateway/templates/gateway-rbac.yaml
T
ximenchuifeng ceeb5474a9 feat(gateway): 更新中心集群支撑——prepull Role + ArgoCD 配置可选注入(暂驻分支不合并)
- gateway-rbac 追加 gateway-prepull-manager Role/RoleBinding(daemonsets
  增删查 + pods 只读,挂既有 gateway-sa):更新中心预拉取 DS 编排所需
- gateway Deployment 支持可选注入 gateway.updateCenter.argocdUrl /
  argocdTokenSecret → env Update__ArgoCd__*(缺省不注入 = 清单功能 503 降级)
2026-09-09 07:54:13 +08:00

67 lines
1.7 KiB
YAML

{{/* Gateway 需要读 Service 列表来发现 edge/agent 等后端及 mqtt-broker(Task 07) */}}
{{/* 权限只有 Service get/list/watch,不包含 Pod/Secret/ConfigMap */}}
{{- if .Values.gateway.rbac }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gateway-sa
labels:
app.kubernetes.io/component: gateway
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gateway-service-reader
labels:
app.kubernetes.io/component: gateway
rules:
- apiGroups: [""]
resources: ["services"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gateway-service-reader-binding
labels:
app.kubernetes.io/component: gateway
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: gateway-service-reader
subjects:
- kind: ServiceAccount
name: gateway-sa
---
# 更新中心(ADR-0074 决策 7):预拉取 DaemonSet 编排——镜像提前铺到各节点,
# 客户点更新时新 Pod 命中本地缓存秒级切换。权限只有 daemonsets 增删查 + pods 只读。
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gateway-prepull-manager
labels:
app.kubernetes.io/component: gateway
rules:
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["create", "get", "list", "delete"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gateway-prepull-manager-binding
labels:
app.kubernetes.io/component: gateway
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: gateway-prepull-manager
subjects:
- kind: ServiceAccount
name: gateway-sa
{{- end }}