apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  # This is the access that the controller needs on a per-namespace basis.
  name: tekton-pipelines-controller-tenant-access
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
rules:
# Read-write access to create Pods and PVCs (for Workspaces)
- resources: ["pods", "persistentvolumeclaims"]
  apiGroups: [""]
  verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
# Write permissions to publish events.
- resources: ["events"]
  apiGroups: [""]
  verbs: ["create", "update", "patch"]
# Read-only access to these.
- resources: ["configmaps", "limitranges", "secrets", "serviceaccounts"]
  apiGroups: [""]
  verbs: ["get", "list", "watch"]
# Read-write access to StatefulSets for Affinity Assistant.
- resources: ["statefulsets"]
  apiGroups: ["apps"]
  verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
