blob: 6dec30f1e0978035c2df49f0e11e8775e39c755e [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{193:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return m}));var n=a(0),r=a.n(n);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){o(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function c(e,t){if(null==e)return{};var a,n,r=function(e,t){if(null==e)return{};var a,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),b=function(e){var t=r.a.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},p=function(e){var t=b(e.components);return r.a.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,l=e.parentName,i=c(e,["components","mdxType","originalType","parentName"]),p=b(a),d=n,m=p["".concat(l,".").concat(d)]||p[d]||u[d]||o;return a?r.a.createElement(m,s(s({ref:t},i),{},{components:a})):r.a.createElement(m,s({ref:t},i))}));function m(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,l=new Array(o);l[0]=d;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:n,l[1]=s;for(var i=2;i<o;i++)l[i]=a[i];return r.a.createElement.apply(null,l)}return r.a.createElement.apply(null,a)}d.displayName="MDXCreateElement"},211:function(e,t,a){"use strict";a.r(t),t.default=a.p+"assets/images/kind-dashboard-96b734dca17dd1d6043efad54f4c4725.png"},75:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return l})),a.d(t,"metadata",(function(){return s})),a.d(t,"toc",(function(){return c})),a.d(t,"default",(function(){return b}));var n=a(3),r=a(7),o=(a(0),a(193)),l={title:"Custom Configuation"},s={unversionedId:"gettingStarted/helm",id:"gettingStarted/helm",isDocsHomePage:!1,title:"Custom Configuation",description:"\x3c!--",source:"@site/docs/gettingStarted/helm.md",slug:"/gettingStarted/helm",permalink:"/docs/next/gettingStarted/helm",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/gettingStarted/helm.md",version:"current",sidebar:"docs",previous:{title:"Submarine Python SDK",permalink:"/docs/next/gettingStarted/python-sdk"},next:{title:"Experiment REST API",permalink:"/docs/next/userDocs/api/experiment"}},c=[{value:"Helm Chart Volume Type",id:"helm-chart-volume-type",children:[{value:"Access to Submarine Server",id:"access-to-submarine-server",children:[]}]},{value:"Kubernetes Dashboard (optional)",id:"kubernetes-dashboard-optional",children:[{value:"Deploy",id:"deploy",children:[]},{value:"Create RBAC",id:"create-rbac",children:[]},{value:"Get access token (optional)",id:"get-access-token-optional",children:[]},{value:"Start dashboard service",id:"start-dashboard-service",children:[]}]}],i={toc:c};function b(e){var t=e.components,l=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},i,l,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"helm-chart-volume-type"},"Helm Chart Volume Type"),Object(o.b)("p",null,"Submarine can support various ",Object(o.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(o.b)("inlineCode",{parentName:"p"},"./helm-charts/submarine/values.yaml"),", or you can override the default values in ",Object(o.b)("inlineCode",{parentName:"p"},"values.yaml")," by ",Object(o.b)("a",{parentName:"p",href:"https://helm.sh/docs/helm/helm_install/"},"helm CLI"),"."),Object(o.b)("h4",{id:"hostpath"},"hostPath"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"In hostPath, you can store data directly in your node."),Object(o.b)("li",{parentName:"ul"},"Usage:",Object(o.b)("ol",{parentName:"li"},Object(o.b)("li",{parentName:"ol"},"Configure setting in ",Object(o.b)("inlineCode",{parentName:"li"},"./helm-charts/submarine/values.yaml"),"."),Object(o.b)("li",{parentName:"ol"},"To enable hostPath storage, set ",Object(o.b)("inlineCode",{parentName:"li"},".storage.type")," to ",Object(o.b)("inlineCode",{parentName:"li"},"host"),"."),Object(o.b)("li",{parentName:"ol"},"To set the root path for your storage, set ",Object(o.b)("inlineCode",{parentName:"li"},".storage.host.root")," to ",Object(o.b)("inlineCode",{parentName:"li"},"<any-path>")))),Object(o.b)("li",{parentName:"ul"},"Example:",Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-yaml"},"# ./helm-charts/submarine/values.yaml\nstorage:\n type: host\n host:\n root: /tmp\n")))),Object(o.b)("h4",{id:"nfs-network-file-system"},"NFS (Network File System)"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"In NFS, it allows multiple clients to access a shared space."),Object(o.b)("li",{parentName:"ul"},"Prerequisite:",Object(o.b)("ol",{parentName:"li"},Object(o.b)("li",{parentName:"ol"},"A pre-existing NFS server. You have two options.",Object(o.b)("ol",{parentName:"li"},Object(o.b)("li",{parentName:"ol"},"Create NFS server",Object(o.b)("pre",{parentName:"li"},Object(o.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(o.b)("inlineCode",{parentName:"li"},"10.96.0.2")),Object(o.b)("li",{parentName:"ol"},"Use your own NFS server"))),Object(o.b)("li",{parentName:"ol"},"Install NFS dependencies in your nodes",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Ubuntu",Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-bash"},"apt-get install -y nfs-common\n"))),Object(o.b)("li",{parentName:"ul"},"CentOS",Object(o.b)("pre",{parentName:"li"},Object(o.b)("code",{parentName:"pre",className:"language-bash"},"yum install nfs-util\n"))))))),Object(o.b)("li",{parentName:"ul"},"Usage:",Object(o.b)("ol",{parentName:"li"},Object(o.b)("li",{parentName:"ol"},"Configure setting in ",Object(o.b)("inlineCode",{parentName:"li"},"./helm-charts/submarine/values.yaml"),"."),Object(o.b)("li",{parentName:"ol"},"To enable NFS storage, set ",Object(o.b)("inlineCode",{parentName:"li"},".storage.type")," to ",Object(o.b)("inlineCode",{parentName:"li"},"nfs"),"."),Object(o.b)("li",{parentName:"ol"},"To set the ip for NFS server, set ",Object(o.b)("inlineCode",{parentName:"li"},".storage.nfs.ip")," to ",Object(o.b)("inlineCode",{parentName:"li"},"<any-ip>")))),Object(o.b)("li",{parentName:"ul"},"Example:",Object(o.b)("pre",{parentName:"li"},Object(o.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(o.b)("h3",{id:"access-to-submarine-server"},"Access to Submarine Server"),Object(o.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(o.b)("strong",{parentName:"p"},Object(o.b)("em",{parentName:"strong"},"false"))," in ",Object(o.b)("inlineCode",{parentName:"p"},"./helm-charts/submarine/values.yaml"),"."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre",className:"language-yaml"},"# Use Traefik by default\ntraefik:\n enabled: true\n")),Object(o.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(o.b)("inlineCode",{parentName:"p"},"./helm-charts/submarine/charts/traefik/values.yaml")," and ",Object(o.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(o.b)("p",null,Object(o.b)("em",{parentName:"p"},"Notice:"),"\nIf you use ",Object(o.b)("inlineCode",{parentName:"p"},"kind")," to run local Kubernetes cluster,\nplease refer to this ",Object(o.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(o.b)("pre",null,Object(o.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(o.b)("pre",null,Object(o.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(o.b)("p",null,"If minikube is installed, use the following command to find the URL to the Submarine server."),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"$ minikube service submarine-traefik --url\n")),Object(o.b)("h2",{id:"kubernetes-dashboard-optional"},"Kubernetes Dashboard (optional)"),Object(o.b)("h3",{id:"deploy"},"Deploy"),Object(o.b)("p",null,"To deploy Dashboard, execute the following command:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml\n")),Object(o.b)("h3",{id:"create-rbac"},"Create RBAC"),Object(o.b)("p",null,"Run the following commands to grant the cluster access permission of dashboard:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"kubectl create serviceaccount dashboard-admin-sa\nkubectl create clusterrolebinding dashboard-admin-sa --clusterrole=cluster-admin --serviceaccount=default:dashboard-admin-sa\n")),Object(o.b)("h3",{id:"get-access-token-optional"},"Get access token (optional)"),Object(o.b)("p",null,"If you want to use the token to login the dashboard, run the following commands to get key:"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"kubectl get secrets\n# select the right dashboard-admin-sa-token to describe the secret\nkubectl describe secret dashboard-admin-sa-token-6nhkx\n")),Object(o.b)("h3",{id:"start-dashboard-service"},"Start dashboard service"),Object(o.b)("pre",null,Object(o.b)("code",{parentName:"pre"},"kubectl proxy\n")),Object(o.b)("p",null,"Now access Dashboard at:"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/")),Object(o.b)("p",null,"Dashboard screenshot:"),Object(o.b)("p",null,Object(o.b)("img",{src:a(211).default})))}b.isMDXComponent=!0}}]);