Skip to content

Commit

Permalink
Clean up kustomization manifests (#10)
Browse files Browse the repository at this point in the history
* Clean up kustomization files

* Update .gitignore file

* Update README.md with setup instructions
  • Loading branch information
Jeffwan authored Aug 4, 2021
1 parent 5722272 commit 7b0ff83
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 25 deletions.
5 changes: 5 additions & 0 deletions bytedance/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ testbin/*
*.swp
*.swo
*~

# Operator test fiels and coverage file
testbin/
cover.out

22 changes: 22 additions & 0 deletions bytedance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ We will follow the path of the predecessors and make it better.
- Support ray cluster rolling upgrade. (coming soon)
- Expose rich telemetry of ray clusters. (coming soon)

## Quick Start

1. Build image and update
```
git clone https://github.com/ray-project/ray-contrib.git
cd ray-contrib/bytedance && IMG=${org}/${repo}:${tag} make docker-build
# push your images to registry
```

2. Deploy ray-operator

```
IMG=${org}/${repo}:${tag} make deploy
```

2. Deploy simple ray cluster

```
kubectl apply -f https://raw.githubusercontent.com/ray-project/ray-contrib/master/bytedance/examples/cluster-simple.yaml
```


## Discussion, Contribution and Support

If you have questions or what to get the latest project news, you can connect with us in the following ways:
Expand Down
2 changes: 1 addition & 1 deletion bytedance/config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resources:
- bases/ray.io_rayclusters.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
#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
Expand Down
12 changes: 6 additions & 6 deletions bytedance/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Adds namespace to all resources.
namespace: ray-operator-system
namespace: ray-system

# Value of this field is prepended to the
# names of all resources, e.g. a deployment named
# "wordpress" becomes "alices-wordpress".
# Note that it should also match with the prefix (text before '-') of the namespace
# field above.
namePrefix: ray-operator-
#namePrefix: ray-operator-

# Labels to add to all resources and selectors.
#commonLabels:
# someName: someValue

bases:
resources:
- ../crd
- ../rbac
- ../manager
Expand All @@ -24,11 +24,11 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
#patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
#- manager_auth_proxy_patch.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
Expand All @@ -44,7 +44,7 @@ patchesStrategicMerge:
#- webhookcainjection_patch.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
#vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
Expand Down
10 changes: 8 additions & 2 deletions bytedance/config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ generatorOptions:
disableNameSuffixHash: true

configMapGenerator:
- name: manager-config
files:
- files:
- controller_manager_config.yaml
name: manager-config
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: bytedance/ray-operator
newTag: v0.1.0
12 changes: 6 additions & 6 deletions bytedance/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
control-plane: ray-operator
name: system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: controller-manager
name: ray-operator
namespace: system
labels:
control-plane: controller-manager
control-plane: ray-operator
spec:
selector:
matchLabels:
control-plane: controller-manager
control-plane: ray-operator
replicas: 1
template:
metadata:
labels:
control-plane: controller-manager
control-plane: ray-operator
spec:
securityContext:
runAsNonRoot: true
Expand Down Expand Up @@ -52,5 +52,5 @@ spec:
requests:
cpu: 100m
memory: 20Mi
serviceAccountName: controller-manager
serviceAccountName: ray-operator-service-account
terminationGracePeriodSeconds: 10
8 changes: 4 additions & 4 deletions bytedance/config/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resources:
# Comment the following 4 lines if you want to disable
# the auth proxy (https://github.com/brancz/kube-rbac-proxy)
# which protects your /metrics endpoint.
- auth_proxy_service.yaml
- auth_proxy_role.yaml
- auth_proxy_role_binding.yaml
- auth_proxy_client_clusterrole.yaml
#- auth_proxy_service.yaml
#- auth_proxy_role.yaml
#- auth_proxy_role_binding.yaml
#- auth_proxy_client_clusterrole.yaml
2 changes: 1 addition & 1 deletion bytedance/config/rbac/leader_election_role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: leader-election-role
name: ray-operator-leader-election-role
rules:
- apiGroups:
- ""
Expand Down
4 changes: 2 additions & 2 deletions bytedance/config/rbac/leader_election_role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: leader-election-role
name: ray-operator-leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: ray-operator-service-account
namespace: system
4 changes: 2 additions & 2 deletions bytedance/config/rbac/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: manager-role
name: ray-operator-cluster-role
subjects:
- kind: ServiceAccount
name: controller-manager
name: ray-operator-service-account
namespace: system
2 changes: 1 addition & 1 deletion bytedance/config/rbac/service_account.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: controller-manager
name: ray-operator-service-account
namespace: system

0 comments on commit 7b0ff83

Please sign in to comment.