diff --git a/rbac.yaml b/rbac.yaml new file mode 100644 index 0000000..c7248fa --- /dev/null +++ b/rbac.yaml @@ -0,0 +1,41 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: tekton-triggers-sa + namespace: tekton-pipelines +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: tekton-triggers-role + namespace: tekton-pipelines +rules: + # Permissions to allow the EventListener to see its own config + - apiGroups: ["triggers.tekton.dev"] + resources: ["eventlisteners", "triggerbindings", "triggertemplates", "triggers"] + verbs: ["get", "list", "watch"] + # Permissions to allow the EventListener to start pipelines + - apiGroups: ["tekton.dev"] + resources: ["pipelineruns", "taskruns"] + verbs: ["create"] + # Permissions to allow the EventListener to create dynamic namespaces/secrets (for Previews) + - apiGroups: [""] + resources: ["namespaces", "secrets", "configmaps"] + verbs: ["get", "list", "create", "update", "patch"] + # Permissions for HelmReleases in Preview namespaces + - apiGroups: ["helm.toolkit.fluxcd.io"] + resources: ["helmreleases"] + verbs: ["get", "list", "create", "update", "patch"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: tekton-triggers-binding + namespace: tekton-pipelines +subjects: + - kind: ServiceAccount + name: tekton-triggers-sa +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: tekton-triggers-role \ No newline at end of file