Skip to content

Commit ccab923

Browse files
[Release] Release v1.4.0-rc.0 helm chart (#65)
Signed-off-by: Chi-Sheng Liu <[email protected]>
1 parent ec7eaf4 commit ccab923

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+5722
-790
lines changed

helm-chart/Makefile

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
.SILENT:
2+
3+
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
4+
ifeq (,$(shell go env GOBIN))
5+
GOBIN=$(shell go env GOPATH)/bin
6+
else
7+
GOBIN=$(shell go env GOBIN)
8+
endif
9+
10+
# Setting SHELL to bash allows bash commands to be executed by recipes.
11+
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
12+
SHELL = /usr/bin/env bash -o pipefail
13+
.SHELLFLAGS = -ec
14+
15+
# Absolute path to Makefile (trim trailing slash).
16+
WORKDIR ?= $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
17+
18+
# Absolute paths to Helm charts.
19+
KUBERAY_OPERATOR_CHART_PATH ?= $(WORKDIR)/kuberay-operator
20+
KUBERAY_APISERVER_CHART_PATH ?= $(WORKDIR)/kuberay-apiserver
21+
RAY_CLUSTER_CHART_PATH ?= $(WORKDIR)/ray-cluster
22+
23+
# Tool versions.
24+
HELM_VERSION ?= v3.17.3
25+
HELM_UNITTEST_VERSION ?= 0.8.1
26+
HELM_DOCS_VERSION ?= v1.14.2
27+
28+
# Tool binaries.
29+
LOCALBIN ?= $(WORKDIR)/bin
30+
HELM ?= $(LOCALBIN)/helm-$(HELM_VERSION)
31+
HELM_DOCS ?= $(LOCALBIN)/helm-docs-$(HELM_DOCS_VERSION)
32+
33+
##@ General
34+
35+
# The help target prints out all targets with their descriptions organized
36+
# beneath their categories. The categories are represented by '##@' and the
37+
# target descriptions by '##'. The awk command is responsible for reading the
38+
# entire set of makefiles included in this invocation, looking for lines of the
39+
# file as xyz: ## something, and then pretty-format the target and help. Then,
40+
# if there's a line with ##@ something, that gets pretty-printed as a category.
41+
# More info on the usage of ANSI control characters for terminal formatting:
42+
# https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
43+
# More info on the awk command:
44+
# http://linuxcommand.org/lc3_adv_awk.php
45+
46+
.PHONY: help
47+
help: ## Display this help.
48+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-30s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
49+
50+
##@ Helm
51+
52+
.PHONY: helm-unittest
53+
helm-unittest: helm-unittest-plugin ## Run Helm chart unittests.
54+
$(HELM) unittest $(KUBERAY_OPERATOR_CHART_PATH) --file "tests/**/*_test.yaml" --strict --debug
55+
$(HELM) unittest $(KUBERAY_APISERVER_CHART_PATH) --file "tests/**/*_test.yaml" --strict --debug
56+
$(HELM) unittest $(RAY_CLUSTER_CHART_PATH) --file "tests/**/*_test.yaml" --strict --debug
57+
58+
.PHONY: helm-lint
59+
helm-lint: ## Run Helm chart lint test.
60+
docker run --rm --workdir /workspace --volume $(WORKDIR):/workspace quay.io/helmpack/chart-testing:v3.12.0 \
61+
ct lint --chart-dirs=. --charts=kuberay-operator,kuberay-apiserver,ray-cluster --target-branch=master --validate-maintainers=false
62+
63+
.PHONY: helm-docs
64+
helm-docs: helm-docs-plugin ## Generates markdown documentation for Helm charts from requirements and values files.
65+
$(HELM_DOCS) --chart-search-root=$(WORKDIR) --chart-to-generate=$(KUBERAY_OPERATOR_CHART_PATH) --sort-values-order=file
66+
67+
##@ Dependencies
68+
69+
$(LOCALBIN):
70+
mkdir -p $(LOCALBIN)
71+
72+
.PHONY: helm
73+
helm: $(HELM) ## Download helm locally if necessary.
74+
$(HELM): $(LOCALBIN)
75+
$(call go-install-tool,$(HELM),helm.sh/helm/v3/cmd/helm,$(HELM_VERSION))
76+
77+
.PHONY: helm-unittest-plugin
78+
helm-unittest-plugin: helm ## Download helm unittest plugin locally if necessary.
79+
if [ -z "$(shell $(HELM) plugin list | grep unittest)" ]; then \
80+
echo "Installing helm unittest plugin"; \
81+
$(HELM) plugin install https://github.com/helm-unittest/helm-unittest.git --version $(HELM_UNITTEST_VERSION); \
82+
fi
83+
84+
.PHONY: helm-docs-plugin
85+
helm-docs-plugin: $(HELM_DOCS) ## Download helm-docs plugin locally if necessary.
86+
$(HELM_DOCS): $(LOCALBIN)
87+
$(call go-install-tool,$(HELM_DOCS),github.com/norwoodj/helm-docs/cmd/helm-docs,$(HELM_DOCS_VERSION))
88+
89+
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
90+
# $1 - target path with name of binary (ideally with version)
91+
# $2 - package url which can be installed
92+
# $3 - specific version of package
93+
define go-install-tool
94+
@[ -f $(1) ] || { \
95+
set -e; \
96+
package=$(2)@$(3) ;\
97+
echo "Downloading $${package}" ;\
98+
GOBIN=$(LOCALBIN) go install $${package} ;\
99+
mv "$$(echo "$(1)" | sed "s/-$(3)$$//")" $(1) ;\
100+
}
101+
endef
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Patterns to ignore when building packages.
22
# This supports shell glob matching, relative path matching, and
33
# negation (prefixed with !). Only one pattern per line.
4-
.DS_Store
4+
5+
ci/
6+
.helmignore
7+
58
# Common VCS dirs
69
.git/
710
.gitignore
@@ -10,14 +13,27 @@
1013
.hg/
1114
.hgignore
1215
.svn/
16+
1317
# Common backup files
1418
*.swp
1519
*.bak
1620
*.tmp
1721
*.orig
1822
*~
23+
1924
# Various IDEs
25+
*.tmproj
2026
.project
2127
.idea/
22-
*.tmproj
2328
.vscode/
29+
30+
# helm-unittest
31+
tests
32+
.debug
33+
__snapshot__
34+
35+
# helm-docs
36+
README.md.gotmpl
37+
38+
# MacOS
39+
.DS_Store

helm-chart/kuberay-apiserver/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.3.0
18+
version: 1.4.0-rc.0

helm-chart/kuberay-apiserver/README.md

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,65 @@ This document provides instructions to install the KubeRay API Server with a Hel
44

55
## Helm
66

7-
Make sure the version of Helm is v3+. Currently, [existing CI tests](https://github.com/ray-project/kuberay/blob/master/.github/workflows/helm-lint.yaml) are based on Helm v3.4.1 and v3.9.4.
7+
Make sure the version of Helm is v3+. Currently, [existing CI tests] are based on Helm v3.4.1 and
8+
v3.9.4.
89

910
```sh
1011
helm version
1112
```
1213

1314
## Install KubeRay API Server
1415

15-
* Install a stable version via Helm repository (only supports KubeRay v0.4.0+)
16-
```sh
17-
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
16+
### Without security proxy
1817

19-
# Install the KubeRay API Server at Version v1.1.0.
20-
helm install kuberay-apiserver kuberay/kuberay-apiserver --version 1.1.0
18+
- Install a stable version via Helm repository
2119

22-
# Check that the KubeRay API Server is running in the "default" namespaces.
23-
kubectl get pods
24-
# NAME READY STATUS RESTARTS AGE
25-
# kuberay-apiserver-xxxxxx 1/1 Running 0 17s
26-
```
20+
```sh
21+
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
22+
helm repo update
23+
# Install KubeRay APIServer without security proxy
24+
helm install kuberay-apiserver kuberay/kuberay-apiserver --version 1.4.0 --set security=null
25+
```
26+
27+
- Install the nightly version
28+
29+
```sh
30+
# Step1: Clone KubeRay repository
31+
32+
# Step2: Navigate to `helm-chart/kuberay-apiserver`
33+
cd helm-chart/kuberay-apiserver
34+
35+
# Step3: Install the KubeRay apiserver
36+
helm install kuberay-apiserver . --set security=null
37+
```
38+
39+
### With security proxy
2740

28-
* Install the nightly version
29-
```sh
30-
# Step1: Clone KubeRay repository
41+
- Install a stable version via Helm repository
3142

32-
# Step2: Move to `helm-chart/kuberay-apiserver`
43+
```sh
44+
helm repo add kuberay https://ray-project.github.io/kuberay-helm/
45+
helm repo update
46+
# Install KubeRay APIServer
47+
helm install kuberay-apiserver kuberay/kuberay-apiserver --version 1.4.0
48+
```
49+
50+
- Install the nightly version
51+
52+
```sh
53+
# Step1: Clone KubeRay repository
3354

34-
# Step3: Install the KubeRay apiserver
35-
helm install kuberay-apiserver .
36-
```
55+
# Step2: Navigate to `helm-chart/kuberay-apiserver`
56+
cd helm-chart/kuberay-apiserver
57+
58+
# Step3: Install the KubeRay apiserver
59+
helm install kuberay-apiserver .
60+
```
61+
62+
> [!IMPORTANT]
63+
> If you receive an "Unauthorized" error when making a request, please add an
64+
> authorization header to the request: `-H 'Authorization: 12345'` or install the
65+
> APIServer without a security proxy.
3766
3867
## List the chart
3968

@@ -55,3 +84,5 @@ helm uninstall kuberay-apiserver
5584
kubectl get pods
5685
# No resources found in default namespace.
5786
```
87+
88+
[existing CI tests]: https://github.com/ray-project/kuberay/blob/master/.github/workflows/helm-lint.yaml
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
image:
2+
repository: kuberay/apiserver
3+
tag: local
4+
pullPolicy: Never
5+
6+
security:
7+
proxy:
8+
repository: kuberay/security-proxy
9+
tag: local
10+
pullPolicy: Never

helm-chart/kuberay-apiserver/templates/deployment.yaml

Lines changed: 54 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,53 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: {{ .Values.name }}
5+
namespace: {{ .Release.Namespace }}
56
labels:
6-
{{ include "kuberay-apiserver.labels" . | indent 4 }}
7-
{{- if .Values.labels }}
8-
{{- toYaml .Values.labels | nindent 4 }}
9-
{{- end }}
7+
{{- include "kuberay-apiserver.labels" . | nindent 4 }}
8+
{{- with .Values.labels }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
1011
spec:
12+
replicas: {{ .Values.replicaCount }}
1113
selector:
1214
matchLabels:
1315
app.kubernetes.io/component: {{ include "kuberay-apiserver.name" . }}
1416
app.kubernetes.io/name: {{ .Release.Name }}
15-
replicas: {{ .Values.replicaCount }}
1617
template:
1718
metadata:
1819
labels:
1920
app.kubernetes.io/component: {{ include "kuberay-apiserver.name" . }}
2021
app.kubernetes.io/name: {{ .Release.Name }}
21-
{{- if .Values.labels }}
22-
{{- toYaml .Values.labels | nindent 8 }}
22+
{{- with .Values.labels }}
23+
{{- toYaml . | nindent 8 }}
2324
{{- end }}
24-
{{- if .Values.annotations }}
25+
{{- with .Values.annotations }}
2526
annotations:
26-
{{- toYaml .Values.annotations | nindent 8 }}
27+
{{- toYaml . | nindent 8 }}
2728
{{- end }}
2829
spec:
29-
serviceAccountName: {{ .Values.serviceAccount.name }}
3030
containers:
3131
- name: {{ .Values.name }}-container
3232
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
33-
imagePullPolicy: {{ .Values.image.pullPolicy }}
33+
{{- with .Values.image.pullPolicy }}
34+
imagePullPolicy: {{ . }}
35+
{{- end }}
36+
args:
37+
{{- $argList := list -}}
38+
{{- $argList = append $argList (printf "--enable-api-server-v2=%t" .Values.enableAPIServerV2) -}}
39+
{{- if .Values.cors }}
40+
{{- with .Values.cors.allowOrigin }}
41+
{{- $argList = append $argList (printf "--cors-allow-origin=%s" .) -}}
42+
{{- end }}
43+
{{- end }}
44+
{{- (printf "\n") -}}
45+
{{- $argList | toYaml | indent 10 }}
3446
ports:
3547
{{- toYaml .Values.containerPort | nindent 8 }}
48+
{{- with .Values.resources }}
3649
resources:
37-
{{- toYaml .Values.resources | nindent 10 }}
50+
{{- toYaml . | nindent 10 }}
51+
{{- end }}
3852
livenessProbe:
3953
httpGet:
4054
path: /healthz
@@ -46,35 +60,38 @@ spec:
4660
{{- if .Values.security }}
4761
- name: security-proxy-container
4862
image: "{{ .Values.security.proxy.repository }}:{{ .Values.security.proxy.tag }}"
49-
imagePullPolicy: {{ .Values.security.proxy.pullPolicy }}
63+
{{- with .Values.security.proxy.pullPolicy }}
64+
imagePullPolicy: {{ . }}
65+
{{- end }}
5066
ports:
51-
- name: http
52-
containerPort: {{ .Values.security.env.HTTP_LOCAL_PORT }}
53-
protocol: TCP
54-
- name: grpc
55-
containerPort: {{ .Values.security.env.GRPC_LOCAL_PORT }}
56-
protocol: TCP
67+
- name: http
68+
containerPort: {{ .Values.security.env.HTTP_LOCAL_PORT }}
69+
protocol: TCP
70+
- name: grpc
71+
containerPort: {{ .Values.security.env.GRPC_LOCAL_PORT }}
72+
protocol: TCP
5773
env:
58-
{{- range $key, $value := .Values.security.env }}
59-
- name: {{ $key }}
60-
value: {{ $value | quote }}
74+
{{- range $key, $value := .Values.security.env }}
75+
- name: {{ $key }}
76+
value: {{ $value | quote }}
77+
{{- end }}
78+
{{- range $port := .Values.containerPort }}
79+
{{- if eq $port.name "http" }}
80+
- name: "HTTP_REMOTE_PORT"
81+
value: {{ $port.containerPort | quote }}
6182
{{- end }}
62-
{{- range $port := .Values.containerPort }}
63-
{{- if eq $port.name "http" }}
64-
- name: "HTTP_REMOTE_PORT"
65-
value: {{ $port.containerPort | quote }}
66-
{{- end }}
67-
{{- if eq $port.name "grpc" }}
68-
- name: "GRPC_REMOTE_PORT"
69-
value: {{ $port.containerPort | quote }}
70-
{{- end }}
83+
{{- if eq $port.name "grpc" }}
84+
- name: "GRPC_REMOTE_PORT"
85+
value: {{ $port.containerPort | quote }}
7186
{{- end }}
87+
{{- end }}
88+
{{- with .Values.resources }}
7289
resources:
73-
{{- toYaml .Values.resources | nindent 10 }}
90+
{{- toYaml . | nindent 10 }}
91+
{{- end }}
7492
{{- end }}
75-
76-
{{- if .Values.sidecarContainers }}
77-
{{- toYaml .Values.sidecarContainers | nindent 6 }}
93+
{{- with .Values.sidecarContainers }}
94+
{{- toYaml . | nindent 6 }}
7895
{{- end }}
7996
{{- with .Values.nodeSelector }}
8097
nodeSelector:
@@ -86,5 +103,6 @@ spec:
86103
{{- end }}
87104
{{- with .Values.tolerations }}
88105
tolerations:
89-
{{- toYaml . | nindent 8 }}
106+
{{- toYaml . | nindent 6 }}
90107
{{- end }}
108+
serviceAccountName: {{ .Values.serviceAccount.name }}

helm-chart/kuberay-apiserver/templates/ingress.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ apiVersion: extensions/v1beta1
1616
kind: Ingress
1717
metadata:
1818
name: {{ $fullName }}
19+
namespace: {{ $.Release.Namespace }}
1920
labels:
2021
{{- include "kuberay-apiserver.labels" . | nindent 4 }}
2122
{{- with .Values.ingress.annotations }}

0 commit comments

Comments
 (0)