我正在尝试在具有集群上 kubernetes 配置的服务帐户的上下文中删除tekton kubernetes 资源,并且遇到特定于使用deletecollection
所有 tekton 资源访问的错误。示例错误如下:
pipelines.tekton.dev 被禁止:用户“system:serviceaccount:my-account:default”无法删除命名空间“my-namespace”中 API 组“tekton.dev”中的集合资源“pipelines”
我曾尝试在此处应用RBAC来提供帮助,但仍然遇到相同的错误。我的 RBAC 尝试如下:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: my-role
namespace: my-namespace
rules:
- apiGroups: ["tekton.dev"]
resources: ["pipelines", "pipelineruns", "tasks", "taskruns"]
verbs: ["get", "watch", "list", "delete", "deletecollection"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: my-role-binding
namespace: my-namespace
subjects:
- kind: User
name: system:serviceaccount:my-account:default
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: my-role
apiGroup: rbac.authorization.k8s.io
这些 RBAC 配置继续导致相同的错误。这是必要的还是类似的?在与 tekton 资源交互(特别是删除)时,是否有任何 RBAC 示例?