标记 RBAC
更多信息请查看官方文档
用域控制器的Reconcile
方法上方,用于获取Client-go
需要的权限
可选参数:
group
:权限的组(group.domain)resources
资源类型verbs
需要的权限类型resourceNames
:API名称namespace
权限需要的范围
示例:
// +kubebuilder:rbac:groups="",resources=pods,verbs=create;get;list;watch;update;patch;delete
// +kubebuilder:rbac:groups="",resources=namespaces,verbs="*"
// +kubebuilder:rbac:groups=core,resources=events,verbs=get;list;watch;create;patch
// +kubebuilder:rbac:groups=core,resources=services,verbs="*"
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs="*"
// +kubebuilder:rbac:groups=xxx,resources=xs,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=xxx,resources=xs/status,verbs=get;update;patch
// +kubebuilder:rbac:groups=xx,resources=xs/finalizers,verbs=update