tangzhankun commented on a change in pull request #143: SUBMARINE-333. Docs of submarine server deployment URL: https://github.com/apache/submarine/pull/143#discussion_r365776896
########## File path: docs/submarine-server/setup-kubernetes.md ########## @@ -0,0 +1,99 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +# Deploy Submarine Server on Kubernetes +This guide covers the deployment server on kubernetes cluster. + +## Experiment environment + +### Setup Kubernetes +We recommend using [`kind`](https://kind.sigs.k8s.io/) to setup a Kubernetes cluster on a local machine. + +Running the following command: +``` +kind create cluster --image kindest/node:v1.15.6 --name k8s-submarine +kubectl create namespace submarine +``` + +### Kubernetes Dashboard (optional) + +#### Deploy +To deploy Dashboard, execute following command: +``` +kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml +``` + +#### Create RBAC +Ensure to grant the cluster access permission of dashboard, run the following command: +``` +kubectl create serviceaccount dashboard-admin-sa +kubectl create clusterrolebinding dashboard-admin-sa --clusterrole=cluster-admin --serviceaccount=default:dashboard-admin-sa +``` + +#### Get access token (optional) +If you want to use the token to login the dashboard, run the following command to get key: +``` +kubectl get secrets +# select the right dashboard-admin-sa-token to describe the secret +kubectl describe secret dashboard-admin-sa-token-6nhkx +``` + +#### Access +To start the dashboard service, we can run the following command: +``` +kubectl proxy +``` + +Now access Dashboard at: +> http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/ + +### Setup Submarine + +#### Local + +##### Get package +You can dowload submarine from releases page or build from source. + +##### Configuration +Copy the kube config into `conf/k8s/config` or modify the `conf/submarine-site.xml`: +``` +<property> + <name>submarine.k8s.kube.config</name> + <value>PATH_TO_KUBE_CONFIG</value> +</property> +``` + +##### Start Submarine Server +Running the submarine server, executing the following command: +``` +./bin/submarine-daemon.sh start getMysqlJar +``` + +The REST API URL is: `http://127.0.0.1:8080/api/v1/jobs` + +#### Tensorflow Review comment: When the user read to this part. he/she has deployed the submarine-server. Then this title should be "Run Tensorflow job". And the "[deploy tfjob]" should be "[run tfjob]" ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@submarine.apache.org For additional commands, e-mail: dev-h...@submarine.apache.org