kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cluster-samples-operator
  namespace: openshift-cluster-samples-operator
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - services
  - endpoints
  - persistentvolumeclaims
  - events
  - configmaps
  - secrets
  verbs:
  - "*"
- apiGroups:
  - apps
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  verbs:
  - "*"

---

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cluster-samples-operator
rules:
- apiGroups:
  - samples.operator.openshift.io
  resources:
  - configs
  - configs/status
  verbs:
  - "*"
- apiGroups:
  - config.openshift.io
  resources:
  - clusteroperators
  - clusteroperators/status
  verbs:
  - "*"

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    rbac.authorization.k8s.io/aggregate-to-cluster-reader: "true"
  name: system:openshift:cluster-samples-operator:cluster-reader
rules:
- apiGroups:
  - samples.operator.openshift.io
  resources:
  - configs
  - configs/status
  verbs:
  - get
  - list
  - watch

---

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cluster-samples-operator
  namespace: openshift-cluster-samples-operator
subjects:
- kind: ServiceAccount
  name: cluster-samples-operator
  namespace: openshift-cluster-samples-operator
roleRef:
  kind: Role
  name: cluster-samples-operator

---

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: cluster-samples-operator
subjects:
- kind: ServiceAccount
  name: cluster-samples-operator
  namespace: openshift-cluster-samples-operator
roleRef:
  kind: ClusterRole
  name: cluster-samples-operator
