{{/* 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