What RBAC permissions are required for flux check
to run successfully?
#5217
-
I'm trying to create a GitHub Actions workflow that automatically updates FluxCD to the latest version, but it should also check prerequisites and installation requirements before creating the pull request - if the latest Flux version isn't compatible, the pull request to upgrade it shouldn't be created. When running The ClusterRole looks like this: apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: github-actions-role
rules:
- apiGroups:
- notification.toolkit.fluxcd.io
- source.toolkit.fluxcd.io
- helm.toolkit.fluxcd.io
- image.toolkit.fluxcd.io
- kustomize.toolkit.fluxcd.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- apiextensions.k8s.io
- apps
resources:
- 'deployments'
- 'customresourcedefinitions'
verbs:
- get
- list
- watch
- apiGroups: [""]
resources:
- 'pods'
verbs:
- get
- list
- watch Has anyone done this before and, if so, what RBAC permissions are required for this command to access the resources it needs? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Try with the deployments and CRDs as separate entries |
Beta Was this translation helpful? Give feedback.
-
This is the RBAC needed for the Flux CLI commands that don't alter the cluster state such as apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: flux-view
rules:
- apiGroups:
- source.toolkit.fluxcd.io
- kustomize.toolkit.fluxcd.io
- helm.toolkit.fluxcd.io
- notification.toolkit.fluxcd.io
- image.toolkit.fluxcd.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- deployments
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
- events
- namespaces
verbs:
- get
- list
- watch |
Beta Was this translation helpful? Give feedback.
This is the RBAC needed for the Flux CLI commands that don't alter the cluster state such as
flux get
,flux events
,flux check
: