Skip to content

Commit

Permalink
Auto-generate RBAC manifests by the controller-gen
Browse files Browse the repository at this point in the history
Signed-off-by: Syulin7 <735122171@qq.com>
  • Loading branch information
Syulin7 committed May 31, 2023
1 parent fc8a644 commit 6c88af0
Show file tree
Hide file tree
Showing 9 changed files with 293 additions and 111 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.
# Is controller gen used for code generation?
Expand Down
99 changes: 0 additions & 99 deletions manifests/base/cluster-role.yaml

This file was deleted.

4 changes: 2 additions & 2 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
- ./rbac/cluster-role-binding.yaml
- ./rbac/role.yaml
- service-account.yaml
- service.yaml
- deployment.yaml
File renamed without changes.
275 changes: 275 additions & 0 deletions manifests/base/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
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
Loading

0 comments on commit 6c88af0

Please sign in to comment.