forked from ray-project/kuberay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add deploy manifests for apiserver (ray-project#119)
- Loading branch information
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Build the backend service | ||
FROM golang:1.17 as builder | ||
|
||
WORKDIR /workspace | ||
# Copy the Go Modules manifests | ||
COPY apiserver/go.mod apiserver/go.mod | ||
COPY apiserver/go.sum apiserver/go.sum | ||
|
||
# Copy the go source | ||
COPY proto/ proto/ | ||
COPY ray-operator/ ray-operator/ | ||
COPY apiserver/ apiserver/ | ||
|
||
WORKDIR /workspace/apiserver | ||
# cache deps before building and copying source so that we don't need to re-download as much | ||
# and so that source changes don't invalidate our downloaded layer | ||
RUN go mod download | ||
|
||
# Build | ||
WORKDIR /workspace/apiserver | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o kuberay-apiserver cmd/main.go | ||
|
||
# Use distroless as minimal base image to package the manager binary | ||
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=builder /workspace/apiserver/kuberay-apiserver . | ||
USER 65532:65532 | ||
|
||
ENTRYPOINT ["/kuberay-apiserver"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: kuberay-apiserver | ||
namespace: ray-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: kuberay-apiserver | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: kuberay-apiserver | ||
spec: | ||
serviceAccountName: kuberay-apiserver | ||
containers: | ||
- name: kuberay-apiserver-container | ||
image: kuberay/kuberay-apiserver:v0.1.0 | ||
ports: | ||
- containerPort: 8888 | ||
- containerPort: 8887 | ||
resources: | ||
limits: | ||
cpu: 500m | ||
memory: 500Mi | ||
requests: | ||
cpu: 300m | ||
memory: 300Mi | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kuberay-apiserver-service | ||
annotations: | ||
prometheus.io/path: /metrics | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "8080" | ||
namespace: ray-system | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: kuberay-apiserver | ||
ports: | ||
- name: http | ||
port: 8888 | ||
targetPort: 8888 | ||
nodePort: 31888 | ||
- name: rpc | ||
port: 8887 | ||
targetPort: 8887 | ||
nodePort: 31887 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: kuberay-apiserver | ||
name: kuberay-apiserver | ||
namespace: ray-system | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
labels: | ||
app: kuberay-apiserver | ||
name: kuberay-apiserver | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kuberay-apiserver | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kuberay-apiserver | ||
namespace: ray-system | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
labels: | ||
app: kuberay-apiserver | ||
name: kuberay-apiserver | ||
rules: | ||
- apiGroups: | ||
- ray.io | ||
resources: | ||
- rayclusters | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- configmaps | ||
verbs: | ||
- create | ||
- delete | ||
- get | ||
- list | ||
- patch | ||
- update | ||
- watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- apiserver.yaml |