Skip to content

Commit

Permalink
added support for secure API server build
Browse files Browse the repository at this point in the history
  • Loading branch information
blublinsky committed Dec 15, 2023
1 parent a12f608 commit 96d15de
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
18 changes: 14 additions & 4 deletions apiserver/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ make docker-image

#### Start Kubernetes Deployment

Note that you should make your KubeRay API server image available by either pushing it to an image registry, such as DockerHub or Quay, or by loading the image into the Kubernetes cluster. If you are using a Kind cluster for development, you can run `make load-image` to load the newly built API server image into the Kind cluster. The operator image will also be needed to be loaded on your cluster. You can use `make operator-image` to build a fresh image from sources, and, if you are using a Kind cluster for development, you can run `make load-operator-image`.
Note that you should make your KubeRay API server image available by either pushing it to an image registry, such as DockerHub or Quay, or by loading the image into the Kubernetes cluster. If you are using a Kind cluster for development, you can run `make load-image` to load the newly built API server image into the Kind cluster. The operator image will also be needed to be loaded on your cluster. If you want run secure API server, you can build security proxy using `make security-proxy-image` and load it to the cluster using `make load-security-proxy-image`

You can use `make operator-image` to build a fresh image from sources, and, if you are using a Kind cluster for development, you can run `make load-operator-image`.

```bash
#Optionally, to load the api server image into the local kind cluster created with make cluster
Expand All @@ -168,8 +170,11 @@ make load-image
#To use the helm charts
make deploy
#To use the configuration from deploy/base
#To use the configuration from deploy/base for insecure API server
make install
#To use the configuration from deploy/base for secure API server
make install-secure
```

#### Stop Kubernetes Deployment
Expand All @@ -178,8 +183,11 @@ make install
#To use the helm charts
make undeploy
#To use the configuration
#To use the configuration insecure
make uninstall
#To use the configuration secure
make uninstall-secure
```

#### Local Kind Cluster Deployment
Expand All @@ -190,7 +198,9 @@ As a convenience for local development the following `make` targets are provided
* `make clean-cluster` -- deletes the local kind cluster created with `make cluster`
* `load-image` -- loads the docker image defined by the `IMG` make variable into the kind cluster. The default value for variable is: `kuberay/apiserver:latest`. The name of the image can be changed by using `make load-image -e IMG=<your image name and tag>`
* `operator-image` -- Build the operator image to be loaded in your kind cluster. The operator image build is `kuberay/operator:latest`. The image tag can be overridden from the command line: ( example: `make operator-image -e OPERATOR_IMAGE_TAG=foo`)
* `load-operator-image` -- Load the operator image to the kind cluster created with `make cluster`. It should be used in conjunction with the `deploy-operator targe`
* `load-operator-image` -- Load the operator image to the kind cluster created with `make cluster`. It should be used in conjunction with the `deploy-operator target`
* `security-proxy-image` -- Build the security proxy image to be loaded in your kind cluster. The security proxy image build is `kuberay/security-proxy:latest`. The image tag can be overridden from the command line: ( example: `make security-proxy-image -e SECURITY_IMAGE_TAG=foo`)
* `load-security-proxy-image` -- Load the security proxy image to the kind cluster created with `make cluster`. It should be used in conjunction with the `install-secure`
* `deploy-operator` -- Deploy operator into your cluster. The tag for the operator image is `kuberay/operator:latest`.
* `undeploy-operator` -- Undeploy operator from your cluster
* `load-ray-test-image` -- Load the ray test images into the cluster.
Expand Down
10 changes: 5 additions & 5 deletions apiserver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ operator-image: ## Build the operator image to be loaded in your kind cluster.

.PHONY: security-proxy-image
security-proxy-image: ## Build the security proxy image to be loaded in your kind cluster.
cd ../experimental && $(MAKE) docker-image -e IMG=kuberay/security-proxy:$(OPERATOR_IMAGE_TAG)
cd ../experimental && $(MAKE) docker-image -e IMG=kuberay/security-proxy:$(SECURITY_IMAGE_TAG)

.PHONY: deploy-operator
deploy-operator: ## Deploy operator via helm into the K8s cluster specified in ~/.kube/config.
Expand Down Expand Up @@ -165,21 +165,21 @@ docker-push: ## Push image for the api server.

##@ Deployment
.PHONY: install
install: kustomize docker-image load-image ## Install the kuberay api server to the K8s cluster specified in ~/.kube/config.
install: kustomize docker-image load-image ## Install the kuberay api server without security to the K8s cluster specified in ~/.kube/config.
cd deploy/local/insecure && $(KUSTOMIZE) edit set image kuberay/apiserver=$(IMG)
$(KUSTOMIZE) build deploy/local/insecure | kubectl create -f -

.PHONY: uninstall
uninstall: ## Install the kuberay api server to the K8s cluster specified in ~/.kube/config.
uninstall: ## Remove the kuberay api without security server from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build deploy/local/insecure | kubectl delete -f -

.PHONY: install-secure
install-secure: kustomize docker-image security-proxy-image load-image load-security-proxy-image ## Install the kuberay api server to the K8s cluster specified in ~/.kube/config.
install-secure: kustomize docker-image security-proxy-image load-image load-security-proxy-image ## Install the kuberay api server with security to the K8s cluster specified in ~/.kube/config.
cd deploy/local/secure && $(KUSTOMIZE) edit set image kuberay/apiserver=$(IMG) && $(KUSTOMIZE) edit set image kuberay/security-proxy=kuberay/security-proxy:latest
$(KUSTOMIZE) build deploy/local/secure | kubectl create -f -

.PHONY: uninstall-secure
uninstall-secure: ## Install the kuberay api server to the K8s cluster specified in ~/.kube/config.
uninstall-secure: ## Remove the kuberay api with security server from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build deploy/local/secure | kubectl delete -f -

.PHONY: deploy
Expand Down

1 comment on commit 96d15de

@z103cb
Copy link
Contributor

@z103cb z103cb commented on 96d15de Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Please sign in to comment.