Files

41 lines
1.1 KiB
YAML
Raw Permalink 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.
apiVersion: v1
kind: ServiceAccount
metadata:
name: agent-manager
namespace: agent-manager
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: agent-manager-role
rules:
# 管理ai-agents命名空间的所有权限
- apiGroups: [""]
resources: ["pods", "pods/log", "pods/status"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get", "list", "create"]
# 允许访问所有命名空间的命名空间资源(用于确保命名空间存在)
- apiGroups: [""]
resources: ["namespaces"]
verbs: ["get"]
resourceNames: ["ai-agents"]
# Metrics权限(如果安装了metrics-server)
- apiGroups: ["metrics.k8s.io"]
resources: ["pods"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: agent-manager-binding
subjects:
- kind: ServiceAccount
name: agent-manager
namespace: agent-manager
roleRef:
kind: ClusterRole
name: agent-manager-role
apiGroup: rbac.authorization.k8s.io