Skip to content

Commit

Permalink
Remove unused generated manifest from kubebuilder (#11)
Browse files Browse the repository at this point in the history
1. Remove webhook related manifest and we will use defaulters later.
2. Add namespaced Role and Rolebinding for internal environment
  • Loading branch information
Jeffwan committed Aug 7, 2021
1 parent 7b0ff83 commit 2587723
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 157 deletions.
2 changes: 1 addition & 1 deletion bytedance/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=ray-operator-clusterrole webhook paths="./..." output:crd:artifacts:config=config/crd/bases

generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down
15 changes: 0 additions & 15 deletions bytedance/config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,3 @@
resources:
- bases/ray.io_rayclusters.yaml
#+kubebuilder:scaffold:crdkustomizeresource

#patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_rayclusters.yaml
#+kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- patches/cainjection_in_rayclusters.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml
19 changes: 0 additions & 19 deletions bytedance/config/crd/kustomizeconfig.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions bytedance/config/crd/patches/cainjection_in_rayclusters.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions bytedance/config/crd/patches/webhook_in_rayclusters.yaml

This file was deleted.

1 change: 1 addition & 0 deletions bytedance/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resources:
- ../crd
- ../rbac
- ../manager
- namespace.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
Expand Down
26 changes: 0 additions & 26 deletions bytedance/config/default/manager_auth_proxy_patch.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions bytedance/config/default/manager_config_patch.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions bytedance/config/default/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: ray-operator
name: system

6 changes: 0 additions & 6 deletions bytedance/config/manager/manager.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: ray-operator
name: system
---
apiVersion: apps/v1
kind: Deployment
Expand Down
9 changes: 0 additions & 9 deletions bytedance/config/rbac/auth_proxy_client_clusterrole.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions bytedance/config/rbac/auth_proxy_role.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions bytedance/config/rbac/auth_proxy_service.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion bytedance/config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: leader-election-rolebinding
name: ray-operator-leader-election-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
81 changes: 81 additions & 0 deletions bytedance/config/rbac/namespace_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
creationTimestamp: null
name: ray-operator-role
rules:
- 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/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ray.io
resources:
- rayclusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ray.io
resources:
- rayclusters/finalizers
verbs:
- update
- apiGroups:
- ray.io
resources:
- rayclusters/status
verbs:
- get
- patch
- update
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: RoleBinding
metadata:
name: proxy-rolebinding
name: ray-operator-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: proxy-role
kind: Role
name: ray-operator-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: ray-operator-service-account
namespace: system
2 changes: 1 addition & 1 deletion bytedance/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
name: ray-operator-clusterrole
rules:
- apiGroups:
- ""
Expand Down
4 changes: 2 additions & 2 deletions bytedance/config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: manager-rolebinding
name: ray-operator-clusterrole-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ray-operator-cluster-role
name: ray-operator-clusterrole
subjects:
- kind: ServiceAccount
name: ray-operator-service-account
Expand Down

0 comments on commit 2587723

Please sign in to comment.