Skip to content

Commit

Permalink
Auto-generate RBAC manifests by the controller-gen (#1815)
Browse files Browse the repository at this point in the history
Signed-off-by: Syulin7 <735122171@qq.com>
  • Loading branch information
Syulin7 committed Jun 2, 2023
1 parent 1bb8da0 commit 4043955
Show file tree
Hide file tree
Showing 12 changed files with 308 additions and 112 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ help: ## Display this help.
##@ Development

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./pkg/apis/..." output:crd:artifacts:config=manifests/base/crds
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=training-operator webhook paths="./pkg/..." output:crd:artifacts:config=manifests/base/crds output:rbac:artifacts:config=manifests/base/rbac

generate: controller-gen ## Generate apidoc, sdk and code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate/boilerplate.go.txt" paths="./pkg/apis/..."
Expand Down
99 changes: 0 additions & 99 deletions manifests/base/cluster-role.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions manifests/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./crds
- cluster-role-binding.yaml
- cluster-role.yaml
- service-account.yaml
- ./rbac/cluster-role-binding.yaml
- ./rbac/role.yaml
- ./rbac/service-account.yaml
- service.yaml
- deployment.yaml
File renamed without changes.
274 changes: 274 additions & 0 deletions manifests/base/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: training-operator
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- list
- update
- watch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods/exec
verbs:
- create
- apiGroups:
- ""
resources:
- serviceaccounts
verbs:
- create
- get
- list
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- mpijobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- mpijobs/finalizers
verbs:
- update
- apiGroups:
- kubeflow.org
resources:
- mpijobs/status
verbs:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- mxjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- mxjobs/finalizers
verbs:
- update
- apiGroups:
- kubeflow.org
resources:
- mxjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- paddlejobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- paddlejobs/finalizers
verbs:
- update
- apiGroups:
- kubeflow.org
resources:
- paddlejobs/status
verbs:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- pytorchjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- pytorchjobs/finalizers
verbs:
- update
- apiGroups:
- kubeflow.org
resources:
- pytorchjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- tfjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- tfjobs/finalizers
verbs:
- update
- apiGroups:
- kubeflow.org
resources:
- tfjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- kubeflow.org
resources:
- xgboostjobs
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- kubeflow.org
resources:
- xgboostjobs/finalizers
verbs:
- update
- apiGroups:
- kubeflow.org
resources:
- xgboostjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
verbs:
- create
- list
- update
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
verbs:
- create
- list
- update
- watch
- apiGroups:
- scheduling.sigs.k8s.io
resources:
- podgroups
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- scheduling.volcano.sh
resources:
- podgroups
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
File renamed without changes.
Loading

0 comments on commit 4043955

Please sign in to comment.