From e8baea6ae4148228a093050b60c5fb6b87df9e91 Mon Sep 17 00:00:00 2001 From: Howard Lau Date: Thu, 29 Oct 2020 11:37:49 +0000 Subject: [PATCH] fix rbac Signed-off-by: Howard Lau --- config/rbac/role.yaml | 15 +++++++++++++-- controllers/seaweed_controller.go | 5 +++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 877545c..234ba6c 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -9,7 +9,7 @@ rules: - apiGroups: - apps resources: - - deployments + - statefulsets verbs: - create - delete @@ -22,7 +22,6 @@ rules: - "" resources: - configmaps - - services verbs: - create - delete @@ -38,6 +37,18 @@ rules: verbs: - get - list +- apiGroups: + - "" + resources: + - services + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - networking.k8s.io resources: diff --git a/controllers/seaweed_controller.go b/controllers/seaweed_controller.go index d7f5758..e111ca4 100644 --- a/controllers/seaweed_controller.go +++ b/controllers/seaweed_controller.go @@ -38,8 +38,9 @@ type SeaweedReconciler struct { // +kubebuilder:rbac:groups=seaweed.seaweedfs.com,resources=seaweeds,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=seaweed.seaweedfs.com,resources=seaweeds/status,verbs=get;update;patch -// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=core,resources=services;configmaps,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update;patch;delete // +kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;