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