---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: cephrgw-operator
  namespace: cephrgw-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cephrgw-operator
rules:
  - apiGroups: ["ceph.unkin.net"]
    resources: ["*"]
    verbs: ["*"]
  # The operator delivers RGW access/secret keys into Secrets.
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["create", "patch"]
  - apiGroups: ["coordination.k8s.io"]
    resources: ["leases"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  # v0.3.1 startup check reads its own CRDs to warn if they are stale/missing.
  - apiGroups: ["apiextensions.k8s.io"]
    resources: ["customresourcedefinitions"]
    verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cephrgw-operator
subjects:
  - kind: ServiceAccount
    name: cephrgw-operator
    namespace: cephrgw-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cephrgw-operator
