1"use strict";(self.webpackChunkdocs_rancherdesktop_io=self.webpackChunkdocs_rancherdesktop_io||[]).push([[2415],{4865:(e,t,n)=>{n.d(t,{A:()=>p});n(96540);var r=n(18215),s=n(17559),a=n(47751),o=n(23104),l=n(92303);const i={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};var u=n(74848);function c({className:e}){const{selectedValue:t,selectValue:n,tabValues:s,block:l}=(0,a.uc)(),c=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.a_)(),h=e=>{const r=e.currentTarget,a=c.indexOf(r),o=s[a].value;o!==t&&(d(r),n(o))},p=e=>{let t=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{const n=c.indexOf(e.currentTarget)+1;t=c[n]??c[0];break}case"ArrowLeft":{const n=c.indexOf(e.currentTarget)-1;t=c[n]??c[c.length-1];break}}t?.focus()};return(0,u.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,r.A)("tabs",{"tabs--block":l},e),children:s.map((({value:e,label:n,attributes:s})=>(0,u.jsx)("li",{role:"tab",tabIndex:t===e?0:-1,"aria-selected":t===e,ref:e=>{c.push(e)},onKeyDown:p,onClick:h,...s,className:(0,r.A)("tabs__item",i.tabItem,s?.className,{"tabs__item--active":t===e}),children:n??e},e)))})}function d({children:e}){return(0,u.jsx)("div",{className:"margin-top--md",children:e})}function h({className:e,children:t}){return(0,u.jsxs)("div",{className:(0,r.A)(s.G.tabs.container,"tabs-container",i.tabList),children:[(0,u.jsx)(c,{className:e}),(0,u.jsx)(d,{children:t})]})}function p(e){const t=(0,l.A)(),n=(0,a.OC)(e);return(0,u.jsx)(a.O_,{value:n,children:(0,u.jsx)(h,{className:e.className,children:(0,a.vT)(e.children)})},String(t))}},19365:(e,t,n)=>{n.d(t,{A:()=>i});n(96540);var r=n(18215),s=n(47751);const a={tabItem:"tabItem_Ymn6"};var o=n(74848);function l({children:e,className:t,hidden:n}){return(0,o.jsx)("div",{role:"tabpanel",className:(0,r.A)(a.tabItem,t),hidden:n,children:e})}function i({children:e,className:t,value:n}){const{selectedValue:r,lazy:a}=(0,s.uc)(),i=n===r;return!i&&a?null:(0,o.jsx)(l,{className:t,hidden:!i,children:e})}},28453:(e,t,n)=>{n.d(t,{R:()=>o,x:()=>l});var r=n(96540);const s={},a=r.createContext(s);function o(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(a.Provider,{value:t},e.children)}},47751:(e,t,n)=>{n.d(t,{OC:()=>m,O_:()=>v,uc:()=>f,vT:()=>c});var r=n(96540),s=n(56347),a=n(205),o=n(57485),l=n(31682),i=n(70679),u=n(74848);function c(e){return r.Children.toArray(e).filter((e=>"\n"!==e))}function d(e){const{values:t,children:n}=e;return(0,r.useMemo)((()=>{const e=t??function(e){return r.Children.toArray(e).flatMap((e=>{if(!e)return[];if((0,r.isValidElement)(e)&&function(e){const{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(e))return[e];const t="string"==typeof e.type?e.type:e.type.name;throw new Error(`Docusaurus error: Bad <Tabs> child <${t}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.\nIf you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)})).map((({props:{value:e,label:t,attributes:n,default:r}})=>({value:e,label:t,attributes:n,default:r})))}(n);return function(e){const t=(0,l.XI)(e,((e,t)=>e.value===t.value));if(t.length>0)throw new Error(`Docusaurus error: Duplicate values "${t.map((e=>`'${e.value}'`)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(e),e}),[t,n])}function h({value:e,tabValues:t}){return t.some((t=>t.value===e))}function p({queryString:e=!1,groupId:t}){const n=(0,s.W6)(),a=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!t)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return t??null}({queryString:e,groupId:t});return[(0,o.aZ)(a),(0,r.useCallback)((e=>{if(!a)return;const t=new URLSearchParams(n.location.search);t.set(a,e),n.replace({...n.location,search:t.toString()})}),[a,n])]}function m(e){const{defaultValue:t,queryString:n=!1,groupId:s}=e,o=d(e),[l,u]=(0,r.useState)((()=>function({defaultValue:e,tabValues:t}){if(0===t.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!h({value:e,tabValues:t}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${t.map((e=>e.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const n=t.find((e=>e.default))??t[0];if(!n)throw new Error("Unexpected error: 0 tabValues");return n.value}({defaultValue:t,tabValues:o}))),[c,m]=p({queryString:n,groupId:s}),[b,f]=function({groupId:e}){const t=function(e){return e?`docusaurus.tab.${e}`:null}(e),[n,s]=(0,i.Dv)(t);return[n,(0,r.useCallback)((e=>{t&&s.set(e)}),[t,s])]}({groupId:s}),v=(()=>{const e=c??b;return h({value:e,tabValues:o})?e:null})();(0,a.A)((()=>{v&&u(v)}),[v]);return{selectedValue:l,selectValue:(0,r.useCallback)((e=>{if(!h({value:e,tabValues:o}))throw new Error(`Can't select invalid tab value=${e}`);u(e),m(e),f(e)}
1),[m,f,o]),tabValues:o,lazy:e.lazy??!1,block:e.block??!1}}const b=(0,r.createContext)(null);function f(){const e=r.useContext(b);if(!e)throw new Error("useTabsContext() must be used within a Tabs component");return e}function v(e){return(0,u.jsx)(b.Provider,{value:e.value,children:e.children})}},48090:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>u,default:()=>p,frontMatter:()=>i,metadata:()=>r,toc:()=>d});const r=JSON.parse('{"id":"how-to-guides/create-multi-node-cluster","title":"Create a Multi-Node Cluster with k3d","description":"Rancher Desktop provides a single cluster with single node setup, which is adequate for most local development scenarios. However, there are use cases where, the ability to create a multi node cluster or spin up multiple clusters with flexibilty to switch between clusters is required. Eventhough Rancher Desktop doesn\'t have in-built multi node/cluster functionality, you can use k3d with Rancher Desktop to accomplish the same. k3d is a lightweight wrapper to run k3s (a minimal Kubernetes distribution, which is used by Rancher Desktop as well) in docker. k3d makes it very easy to create single- and multi-node k3s clusters in docker, e.g. for local development on Kubernetes.","source":"@site/versioned_docs/version-1.6/how-to-guides/create-multi-node-cluster.md","sourceDirName":"how-to-guides","slug":"/how-to-guides/create-multi-node-cluster","permalink":"/1.6/how-to-guides/create-multi-node-cluster","draft":false,"unlisted":false,"tags":[],"version":"1.6","frontMatter":{"title":"Create a Multi-Node Cluster with k3d"},"sidebar":"tutorialSidebar","previous":{"title":"Hello World Example","permalink":"/1.6/how-to-guides/hello-world-example"},"next":{"title":"Setup NGINX Ingress Controller","permalink":"/1.6/how-to-guides/setup-NGINX-Ingress-Controller"}}');var s=n(74848),a=n(28453),o=n(4865),l=n(19365);const i={title:"Create a Multi-Node Cluster with k3d"},u=void 0,c={},d=[{value:"Steps to spin up a multi-node cluster",id:"steps-to-spin-up-a-multi-node-cluster",level:3}];function h(e){const t={a:"a",code:"code",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["Rancher Desktop provides a ",(0,s.jsx)(t.strong,{children:"single cluster with single node"})," setup, which is adequate for most local development scenarios. However, there are use cases where, the ability to create a multi node cluster or spin up multiple clusters with flexibilty to switch between clusters is required. Eventhough Rancher Desktop doesn't have in-built multi node/cluster functionality, you can use ",(0,s.jsx)(t.a,{href:"https://k3d.io",children:"k3d"})," with Rancher Desktop to accomplish the same. k3d is a lightweight wrapper to run k3s (a minimal Kubernetes distribution, which is used by Rancher Desktop as well) in docker. k3d makes it very easy to create single- and multi-node k3s clusters in docker, e.g. for local development on Kubernetes."]}),"\n",(0,s.jsx)(t.h3,{id:"steps-to-spin-up-a-multi-node-cluster",children:"Steps to spin up a multi-node cluster"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsxs)(t.p,{children:["Make sure ",(0,s.jsx)(t.strong,{children:"dockerd(moby)"})," is selected as the Container Runtime in the ",(0,s.jsx)(t.strong,{children:"Kubernetes Settings"})," page."]}),"\n"]}),"\n",(0,s.jsxs)(t.li,{children:["\n",(0,s.jsx)(t.p,{children:"Install k3d."}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(o.A,{groupId:"installation-approach",children:[(0,s.jsx)(l.A,{value:"wget",default:!0,children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash\n"})})}),(0,s.jsx)(l.A,{value:"curl",children:(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"curl -s https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash\n"})})})]}),"\n",(0,s.jsxs)(t.ol,{start:"3",children:["\n",(0,s.jsxs)(t.li,{children:["Run ",(0,s.jsx)(t.code,{children:"k3d cluster create"}
1)," command to spin up multi node clusters. For example:"]}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"k3d cluster create two-node-cluster --agents 2\nk3d cluster create three-node-cluster --agents 3\n"})}),"\n",(0,s.jsxs)(t.ol,{start:"4",children:["\n",(0,s.jsxs)(t.li,{children:["k3d sets the newly created cluster as active. You can switch between clusters via ",(0,s.jsx)(t.code,{children:"kubectl config use-context"})," command. For example:"]}),"\n"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:"kubectl config use-context k3d-two-node-cluster\n"})}),"\n",(0,s.jsxs)(t.p,{children:["To learn more about ",(0,s.jsx)(t.strong,{children:"k3s"})," and ",(0,s.jsx)(t.strong,{children:"k3d"}),", refer to these projects' docs at ",(0,s.jsx)(t.a,{href:"https://docs.k3s.io/",children:"k3s docs"})," and ",(0,s.jsx)(t.a,{href:"https://k3d.io/",children:"k3d docs"}),"."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsxs)(t.strong,{children:["\u26a0\ufe0f"," Please note that the clusters created by ",(0,s.jsx)(t.code,{children:"k3d"})," are not managed by Rancher Desktop GUI."]})})]})}function p(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(h,{...e})}):h(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.