Files
mixingx.hub.chart/templates/gateway-rbac.yaml
T
王野 5e83675edf feat(gateway): 添加mqtt-broker服务发现权限注释
Gateway需要读取Service列表来发现edge/agent等后端及mqtt-broker(Task 07)
权限仅包含Service的get/list/watch操作,不涉及Pod/Secret/ConfigMap
2026-08-02 23:47:13 +08:00

39 lines
933 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{/*
Gateway K8s 服务发现 RBAC
gateway 需要读 Service 列表(查 mixingx.io/role 标签)来发现 agent/edge 等
包括 mqtt-broker Service(查 mixingx.io/role=mqtt-broker,Task 07)
权限只有 Service get/list/watch,不包含 Pod/Secret/ConfigMap
*/}}
---
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