blob: 9b18a3b423dbaaa21e7a8ca326b89afcac41a589 [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{144:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return h}));var a=n(0),r=n.n(a);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(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 o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(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 b=r.a.createContext({}),c=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=c(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,i=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),u=c(n),m=a,h=u["".concat(i,".").concat(m)]||u[m]||p[m]||l;return n?r.a.createElement(h,o(o({ref:t},b),{},{components:n})):r.a.createElement(h,o({ref:t},b))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,i=new Array(l);i[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;b<l;b++)i[b]=n[b];return r.a.createElement.apply(null,i)}return r.a.createElement.apply(null,n)}m.displayName="MDXCreateElement"},66:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return c}));var a=n(3),r=n(7),l=(n(0),n(144)),i={title:"Deploy Submarine with Helm"},o={unversionedId:"gettingStarted/helm",id:"gettingStarted/helm",isDocsHomePage:!1,title:"Deploy Submarine with Helm",description:"\x3c!--",source:"@site/docs/gettingStarted/helm.md",slug:"/gettingStarted/helm",permalink:"/docs/gettingStarted/helm",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/gettingStarted/helm.md",version:"current"},s=[{value:"Prerequisite",id:"prerequisite",children:[]},{value:"Deploy Submarine to Kubernetes",id:"deploy-submarine-to-kubernetes",children:[]},{value:"Verify installation",id:"verify-installation",children:[]},{value:"Uninstall Submarine",id:"uninstall-submarine",children:[]},{value:"Volume Type",id:"volume-type",children:[{value:"Access to Submarine Server",id:"access-to-submarine-server",children:[]}]}],b={toc:s};function c(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(l.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(l.b)("h1",{id:"deploy-submarine-with-helm"},"Deploy Submarine with Helm"),Object(l.b)("p",null,"With the help of ",Object(l.b)("a",{parentName:"p",href:"https://helm.sh/"},"Helm"),", users can deploy Submarine service to Kubernetes in one command.\nCheck ",Object(l.b)("a",{parentName:"p",href:"https://github.com/apache/submarine/tree/master/helm-charts/submarine"},"helm-charts/submarine")," for more details."),Object(l.b)("h2",{id:"prerequisite"},"Prerequisite"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"Install Helm v3: ",Object(l.b)("a",{parentName:"li",href:"https://helm.sh/docs/intro/install/"},"https://helm.sh/docs/intro/install/")," "),Object(l.b)("li",{parentName:"ul"},"A Kubernetes environment (ex: minikube or kind)")),Object(l.b)("h2",{id:"deploy-submarine-to-kubernetes"},"Deploy Submarine to Kubernetes"),Object(l.b)("pre",null,Object(l.b)("code",{parentName:"pre",className:"language-bash"},"git clone https://github.com/apache/submarine.git\ncd submarine\nhelm install submarine ./helm-charts/submarine\n")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},'With these commands, the Submarine service will be deployed to the "default" namespace.'),Object(l.b)("li",{parentName:"ul"},"The first time installation will take about 10 mins because the docker images are pulled from ",Object(l.b)("a",{parentName:"li",href:"https://hub.docker.com/r/apache/submarine"},"apache/submarine")," on DockerHub.")),Object(l.b)("h2",{id:"verify-installation"},"Verify installation"),Object(l.b)("pre",null,Object(l.b)("code",{parentName:"pre",className:"language-bash"},"kubectl get all\n")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"TODO: screenshot")),Object(l.b)("h2",{id:"uninstall-submarine"},"Uninstall Submarine"),Object(l.b)("pre",null,Object(l.b)("code",{parentName:"pre",className:"language-bash"},"helm uninstall submarine\n\n# Check\nhelm ls \n")),Object(l.b)("h1",{id:"helm-chart-configuation-valuesyaml"},"Helm chart configuation (values.yaml)"),Object(l.b)("h2",{id:"volume-type"},"Volume Type"),Object(l.b)("p",null,"Submarine can support various ",Object(l.b)("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 ",Object(l.b)("inlineCode",{parentName:"p"},"./helm-charts/submarine/values.yaml"),", or you can override the default values in ",Object(l.b)("inlineCode",{parentName:"p"},"values.yaml")," by ",Object(l.b)("a",{parentName:"p",href:"https://helm.sh/docs/helm/helm_install/"},"helm CLI"),"."),Object(l.b)("h4",{id:"hostpath"},"hostPath"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"In hostPath, you can store data directly in your node."),Object(l.b)("li",{parentName:"ul"},"Usage:",Object(l.b)("ol",{parentName:"li"},Object(l.b)("li",{parentName:"ol"},"Configure setting in ",Object(l.b)("inlineCode",{parentName:"li"},"./helm-charts/submarine/values.yaml"),"."),Object(l.b)("li",{parentName:"ol"},"To enable hostPath storage, set ",Object(l.b)("inlineCode",{parentName:"li"},".storage.type")," to ",Object(l.b)("inlineCode",{parentName:"li"},"host"),"."),Object(l.b)("li",{parentName:"ol"},"To set the root path for your storage, set ",Object(l.b)("inlineCode",{parentName:"li"},".storage.host.root")," to ",Object(l.b)("inlineCode",{parentName:"li"},"<any-path>")))),Object(l.b)("li",{parentName:"ul"},"Example:",Object(l.b)("pre",{parentName:"li"},Object(l.b)("code",{parentName:"pre",className:"language-yaml"},"# ./helm-charts/submarine/values.yaml\nstorage:\n type: host\n host:\n root: /tmp\n")))),Object(l.b)("h4",{id:"nfs-network-file-system"},"NFS (Network File System)"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"In NFS, it allows multiple clients to access a shared space."),Object(l.b)("li",{parentName:"ul"},"Prerequisite:",Object(l.b)("ol",{parentName:"li"},Object(l.b)("li",{parentName:"ol"},"A pre-existing NFS server. You have two options.",Object(l.b)("ol",{parentName:"li"},Object(l.b)("li",{parentName:"ol"},"Create NFS server",Object(l.b)("pre",{parentName:"li"},Object(l.b)("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 ",Object(l.b)("inlineCode",{parentName:"li"},"10.96.0.2")),Object(l.b)("li",{parentName:"ol"},"Use your own NFS server"))),Object(l.b)("li",{parentName:"ol"},"Install NFS dependencies in your nodes",Object(l.b)("ul",{parentName:"li"},Object(l.b)("li",{parentName:"ul"},"Ubuntu",Object(l.b)("pre",{parentName:"li"},Object(l.b)("code",{parentName:"pre",className:"language-bash"},"apt-get install -y nfs-common\n"))),Object(l.b)("li",{parentName:"ul"},"CentOS",Object(l.b)("pre",{parentName:"li"},Object(l.b)("code",{parentName:"pre",className:"language-bash"},"yum install nfs-util\n"))))))),Object(l.b)("li",{parentName:"ul"},"Usage:",Object(l.b)("ol",{parentName:"li"},Object(l.b)("li",{parentName:"ol"},"Configure setting in ",Object(l.b)("inlineCode",{parentName:"li"},"./helm-charts/submarine/values.yaml"),"."),Object(l.b)("li",{parentName:"ol"},"To enable NFS storage, set ",Object(l.b)("inlineCode",{parentName:"li"},".storage.type")," to ",Object(l.b)("inlineCode",{parentName:"li"},"nfs"),"."),Object(l.b)("li",{parentName:"ol"},"To set the ip for NFS server, set ",Object(l.b)("inlineCode",{parentName:"li"},".storage.nfs.ip")," to ",Object(l.b)("inlineCode",{parentName:"li"},"<any-ip>")))),Object(l.b)("li",{parentName:"ul"},"Example:",Object(l.b)("pre",{parentName:"li"},Object(l.b)("code",{parentName:"pre",className:"language-yaml"},"# ./helm-charts/submarine/values.yaml\nstorage:\n type: nfs\n nfs:\n ip: 10.96.0.2\n")))),Object(l.b)("h3",{id:"access-to-submarine-server"},"Access to Submarine Server"),Object(l.b)("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 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("em",{parentName:"strong"},"false"))," in ",Object(l.b)("inlineCode",{parentName:"p"},"./helm-charts/submarine/values.yaml"),"."),Object(l.b)("pre",null,Object(l.b)("code",{parentName:"pre",className:"language-yaml"},"# Use Traefik by default\ntraefik:\n enabled: true\n")),Object(l.b)("p",null,"To access the server from outside of the cluster, we use Traefik ingress controller and\nNodePort for external access.\\\nPlease refer to ",Object(l.b)("inlineCode",{parentName:"p"},"./helm-charts/submarine/charts/traefik/values.yaml")," and ",Object(l.b)("a",{parentName:"p",href:"https://docs.traefik.io/"},"Traefik docs"),"\nfor more details if you want to customize the default value for Traefik."),Object(l.b)("p",null,Object(l.b)("em",{parentName:"p"},"Notice:"),"\nIf you use ",Object(l.b)("inlineCode",{parentName:"p"},"kind")," to run local Kubernetes cluster,\nplease refer to this ",Object(l.b)("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.'),Object(l.b)("pre",null,Object(l.b)("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")),Object(l.b)("pre",null,Object(l.b)("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")),Object(l.b)("p",null,"If minikube is installed, use the following command to find the URL to the Submarine server."),Object(l.b)("pre",null,Object(l.b)("code",{parentName:"pre"},"$ minikube service submarine-traefik --url\n")))}c.isMDXComponent=!0}}]);