blob: 1805473d2487bfd2089cd7fa9c85e17a71fb3c64 [file] [log] [blame]
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[655],{3905:function(e,t,n){n.d(t,{Zo:function(){return p},kt:function(){return h}});var a=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},c=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),c=u(n),h=r,d=c["".concat(s,".").concat(h)]||c[h]||m[h]||l;return n?a.createElement(d,i(i({ref:t},p),{},{components:n})):a.createElement(d,i({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=c;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var u=2;u<l;u++)i[u]=n[u];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}c.displayName="MDXCreateElement"},572:function(e,t,n){n.r(t),n.d(t,{assets:function(){return p},contentTitle:function(){return s},default:function(){return h},frontMatter:function(){return o},metadata:function(){return u},toc:function(){return m}});var a=n(7462),r=n(3366),l=(n(7294),n(3905)),i=["components"],o={title:"Deploy Submarine with Helm"},s=void 0,u={unversionedId:"gettingStarted/helm",id:"version-0.6.0/gettingStarted/helm",title:"Deploy Submarine with Helm",description:"\x3c!--",source:"@site/versioned_docs/version-0.6.0/gettingStarted/helm.md",sourceDirName:"gettingStarted",slug:"/gettingStarted/helm",permalink:"/docs/gettingStarted/helm",editUrl:"https://github.com/apache/submarine/edit/master/website/versioned_docs/version-0.6.0/gettingStarted/helm.md",tags:[],version:"0.6.0",frontMatter:{title:"Deploy Submarine with Helm"}},p={},m=[{value:"Prerequisite",id:"prerequisite",level:2},{value:"Deploy Submarine to Kubernetes",id:"deploy-submarine-to-kubernetes",level:2},{value:"Verify installation",id:"verify-installation",level:2},{value:"Uninstall Submarine",id:"uninstall-submarine",level:2},{value:"Volume Type",id:"volume-type",level:2},{value:"hostPath",id:"hostpath",level:4},{value:"NFS (Network File System)",id:"nfs-network-file-system",level:4},{value:"Access to Submarine Server",id:"access-to-submarine-server",level:3}],c={toc:m};function h(e){var t=e.components,n=(0,r.Z)(e,i);return(0,l.kt)("wrapper",(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h1",{id:"deploy-submarine-with-helm"},"Deploy Submarine with Helm"),(0,l.kt)("p",null,"With the help of ",(0,l.kt)("a",{parentName:"p",href:"https://helm.sh/"},"Helm"),", users can deploy Submarine service to Kubernetes in one command.\nCheck ",(0,l.kt)("a",{parentName:"p",href:"https://github.com/apache/submarine/tree/master/helm-charts/submarine"},"helm-charts/submarine")," for more details."),(0,l.kt)("h2",{id:"prerequisite"},"Prerequisite"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"Install Helm v3: ",(0,l.kt)("a",{parentName:"li",href:"https://helm.sh/docs/intro/install/"},"https://helm.sh/docs/intro/install/")," "),(0,l.kt)("li",{parentName:"ul"},"A Kubernetes environment (ex: minikube or kind)")),(0,l.kt)("h2",{id:"deploy-submarine-to-kubernetes"},"Deploy Submarine to Kubernetes"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash"},"git clone https://github.com/apache/submarine.git\ncd submarine\nhelm install submarine ./helm-charts/submarine\n")),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},'With these commands, the Submarine service will be deployed to the "default" namespace.'),(0,l.kt)("li",{parentName:"ul"},"The first time installation will take about 10 mins because the docker images are pulled from ",(0,l.kt)("a",{parentName:"li",href:"https://hub.docker.com/r/apache/submarine"},"apache/submarine")," on DockerHub.")),(0,l.kt)("h2",{id:"verify-installation"},"Verify installation"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl get all\n")),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"TODO: screenshot")),(0,l.kt)("h2",{id:"uninstall-submarine"},"Uninstall Submarine"),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-bash"},"helm uninstall submarine\n\n# Check\nhelm ls \n")),(0,l.kt)("h1",{id:"helm-chart-configuation-valuesyaml"},"Helm chart configuation (values.yaml)"),(0,l.kt)("h2",{id:"volume-type"},"Volume Type"),(0,l.kt)("p",null,"Submarine can support various ",(0,l.kt)("a",{parentName:"p",href:"https://kubernetes.io/docs/concepts/storage/volumes/#nfs"},"volume types"),", currently including hostPath (default) and NFS. It can be easily configured in the ",(0,l.kt)("inlineCode",{parentName:"p"},"./helm-charts/submarine/values.yaml"),", or you can override the default values in ",(0,l.kt)("inlineCode",{parentName:"p"},"values.yaml")," by ",(0,l.kt)("a",{parentName:"p",href:"https://helm.sh/docs/helm/helm_install/"},"helm CLI"),"."),(0,l.kt)("h4",{id:"hostpath"},"hostPath"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"In hostPath, you can store data directly in your node."),(0,l.kt)("li",{parentName:"ul"},"Usage:",(0,l.kt)("ol",{parentName:"li"},(0,l.kt)("li",{parentName:"ol"},"Configure setting in ",(0,l.kt)("inlineCode",{parentName:"li"},"./helm-charts/submarine/values.yaml"),"."),(0,l.kt)("li",{parentName:"ol"},"To enable hostPath storage, set ",(0,l.kt)("inlineCode",{parentName:"li"},".storage.type")," to ",(0,l.kt)("inlineCode",{parentName:"li"},"host"),"."),(0,l.kt)("li",{parentName:"ol"},"To set the root path for your storage, set ",(0,l.kt)("inlineCode",{parentName:"li"},".storage.host.root")," to ",(0,l.kt)("inlineCode",{parentName:"li"},"<any-path>")))),(0,l.kt)("li",{parentName:"ul"},"Example:",(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre",className:"language-yaml"},"# ./helm-charts/submarine/values.yaml\nstorage:\n type: host\n host:\n root: /tmp\n")))),(0,l.kt)("h4",{id:"nfs-network-file-system"},"NFS (Network File System)"),(0,l.kt)("ul",null,(0,l.kt)("li",{parentName:"ul"},"In NFS, it allows multiple clients to access a shared space."),(0,l.kt)("li",{parentName:"ul"},"Prerequisite:",(0,l.kt)("ol",{parentName:"li"},(0,l.kt)("li",{parentName:"ol"},"A pre-existing NFS server. You have two options.",(0,l.kt)("ol",{parentName:"li"},(0,l.kt)("li",{parentName:"ol"},"Create NFS server",(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre",className:"language-bash"},"kubectl create -f ./dev-support/nfs-server/nfs-server.yaml\n")),"It will create a nfs-server pod in kubernetes cluster, and expose nfs-server ip at ",(0,l.kt)("inlineCode",{parentName:"li"},"10.96.0.2")),(0,l.kt)("li",{parentName:"ol"},"Use your own NFS server"))),(0,l.kt)("li",{parentName:"ol"},"Install NFS dependencies in your nodes",(0,l.kt)("ul",{parentName:"li"},(0,l.kt)("li",{parentName:"ul"},"Ubuntu",(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre",className:"language-bash"},"apt-get install -y nfs-common\n"))),(0,l.kt)("li",{parentName:"ul"},"CentOS",(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre",className:"language-bash"},"yum install nfs-util\n"))))))),(0,l.kt)("li",{parentName:"ul"},"Usage:",(0,l.kt)("ol",{parentName:"li"},(0,l.kt)("li",{parentName:"ol"},"Configure setting in ",(0,l.kt)("inlineCode",{parentName:"li"},"./helm-charts/submarine/values.yaml"),"."),(0,l.kt)("li",{parentName:"ol"},"To enable NFS storage, set ",(0,l.kt)("inlineCode",{parentName:"li"},".storage.type")," to ",(0,l.kt)("inlineCode",{parentName:"li"},"nfs"),"."),(0,l.kt)("li",{parentName:"ol"},"To set the ip for NFS server, set ",(0,l.kt)("inlineCode",{parentName:"li"},".storage.nfs.ip")," to ",(0,l.kt)("inlineCode",{parentName:"li"},"<any-ip>")))),(0,l.kt)("li",{parentName:"ul"},"Example:",(0,l.kt)("pre",{parentName:"li"},(0,l.kt)("code",{parentName:"pre",className:"language-yaml"},"# ./helm-charts/submarine/values.yaml\nstorage:\n type: nfs\n nfs:\n ip: 10.96.0.2\n")))),(0,l.kt)("h3",{id:"access-to-submarine-server"},"Access to Submarine Server"),(0,l.kt)("p",null,"Submarine server by default expose 8080 port within K8s cluster. After Submarine v0.5\nuses Traefik as reverse-proxy by default. If you don't want to\nuse Traefik, you can modify below value to ",(0,l.kt)("strong",{parentName:"p"},(0,l.kt)("em",{parentName:"strong"},"false"))," in ",(0,l.kt)("inlineCode",{parentName:"p"},"./helm-charts/submarine/values.yaml"),"."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-yaml"},"# Use Traefik by default\ntraefik:\n enabled: true\n")),(0,l.kt)("p",null,"To access the server from outside of the cluster, we use Traefik ingress controller and\nNodePort for external access.\\\nPlease refer to ",(0,l.kt)("inlineCode",{parentName:"p"},"./helm-charts/submarine/charts/traefik/values.yaml")," and ",(0,l.kt)("a",{parentName:"p",href:"https://docs.traefik.io/"},"Traefik docs"),"\nfor more details if you want to customize the default value for Traefik."),(0,l.kt)("p",null,(0,l.kt)("em",{parentName:"p"},"Notice:"),"\nIf you use ",(0,l.kt)("inlineCode",{parentName:"p"},"kind")," to run local Kubernetes cluster,\nplease refer to this ",(0,l.kt)("a",{parentName:"p",href:"https://kind.sigs.k8s.io/docs/user/configuration/#extra-port-mappings"},"docs"),'\nand set the configuration "extraPortMappings" when creating the k8s cluster.'),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre"},"kind: Cluster\napiVersion: kind.x-k8s.io/v1alpha4\nnodes:\n- role: control-plane\n extraPortMappings:\n - containerPort: 32080\n hostPort: [the port you want to access]\n")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre"},"# Use nodePort and Traefik ingress controller by default.\n# To access the submarine server, open the following URL in your browser.\nhttp://127.0.0.1:32080\n")),(0,l.kt)("p",null,"If minikube is installed, use the following command to find the URL to the Submarine server."),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre"},"$ minikube service submarine-traefik --url\n")))}h.isMDXComponent=!0}}]);