chore: rbac

This commit is contained in:
eding 2026-02-08 19:30:31 +01:00
parent 8c5d45180e
commit 2f7b8f45a4

41
rbac.yaml Normal file
View file

@ -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