1
0
mirror of synced 2026-02-06 10:55:56 +00:00

Add dedicated service accounts per controller

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2021-01-26 00:46:07 +02:00
parent c219eb2883
commit 1b581d6f51
21 changed files with 95 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
kind: ClusterRole
metadata:
name: crd-controller
rules:
@@ -15,12 +15,17 @@ rules:
- apiGroups: ['notification.toolkit.fluxcd.io']
resources: ['*']
verbs: ['*']
- apiGroups: ['image.toolkit.fluxcd.io']
resources: ['*']
verbs: ['*']
- apiGroups:
- ""
resources:
- configmaps
- configmaps/status
verbs: ['*']
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
@@ -28,6 +33,19 @@ rules:
verbs:
- create
- patch
- apiGroups:
- ""
resources:
- configmaps
- configmaps/status
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- "coordination.k8s.io"
resources:
@@ -42,14 +60,23 @@ rules:
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
kind: ClusterRoleBinding
metadata:
name: crd-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
kind: ClusterRole
name: crd-controller
subjects:
- kind: ServiceAccount
name: default
namespace: system
name: kustomize-controller
- kind: ServiceAccount
name: helm-controller
- kind: ServiceAccount
name: source-controller
- kind: ServiceAccount
name: notification-controller
- kind: ServiceAccount
name: image-reflector-controller
- kind: ServiceAccount
name: image-automation-controller

View File

@@ -1,5 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- role.yaml
- cluster-role.yaml
- controller.yaml
- reconciler.yaml

View File

@@ -8,5 +8,6 @@ roleRef:
name: cluster-admin
subjects:
- kind: ServiceAccount
name: default
namespace: system
name: kustomize-controller
- kind: ServiceAccount
name: helm-controller