# AWOOOI Dev RBAC - 最小權限
# 版本: v1.0 | 日期: 2026-04-01

apiVersion: v1
kind: ServiceAccount
metadata:
  name: awoooi-executor-dev
  namespace: awoooi-dev

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: awoooi-executor-dev-role
  namespace: awoooi-dev
rules:
  - apiGroups: ["apps"]
    resources: ["deployments"]
    verbs: ["get", "list", "watch", "patch", "update"]
  - apiGroups: ["apps"]
    resources: ["deployments/scale"]
    verbs: ["patch", "update"]
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "watch", "delete"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["get", "list", "watch"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: awoooi-executor-dev-binding
  namespace: awoooi-dev
subjects:
  - kind: ServiceAccount
    name: awoooi-executor-dev
    namespace: awoooi-dev
roleRef:
  kind: Role
  name: awoooi-executor-dev-role
  apiGroup: rbac.authorization.k8s.io
