diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 3f9b16e..b9632d2 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -5,6 +5,31 @@ metadata: creationTimestamp: null name: manager-role rules: +- apiGroups: + - "" + resources: + - pods + - services + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - apps + resources: + - statefulsets + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - zookeeper.atmax.io resources: diff --git a/controllers/zookeepercluster_controller.go b/controllers/zookeepercluster_controller.go index 8831c83..c4298cc 100644 --- a/controllers/zookeepercluster_controller.go +++ b/controllers/zookeepercluster_controller.go @@ -45,6 +45,8 @@ type ZookeeperClusterReconciler struct { type reconcileFunc func(ctx context.Context, zk *zookeeperv1alpha1.ZookeeperCluster) error +//+kubebuilder:rbac:groups="",resources=pods;services,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=zookeeper.atmax.io,resources=zookeeperclusters,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=zookeeper.atmax.io,resources=zookeeperclusters/status,verbs=get;update;patch //+kubebuilder:rbac:groups=zookeeper.atmax.io,resources=zookeeperclusters/finalizers,verbs=update