---
# ClusterRole for read-only access across all namespaces
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: ai-bot-readonly-all-namespaces
rules:
- apiGroups: ["*"]
  resources: ["*"]
  verbs: ["get", "list", "watch"]
- apiGroups: [""]
  resources: ["pods/log", "pods/status"]
  verbs: ["get", "list"]
---
# ClusterRoleBinding to grant ai-bot read access everywhere
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: ai-bot-readonly-all-namespaces-binding
subjects:
- kind: ServiceAccount
  name: ai-bot
  namespace: ai
roleRef:
  kind: ClusterRole
  name: ai-bot-readonly-all-namespaces
  apiGroup: rbac.authorization.k8s.io
