Files
rancher-docs/assets/js/e87f9614.d7f55e10.js
T

1 line
8.8 KiB
JavaScript

"use strict";(self.webpackChunkrancher_docs=self.webpackChunkrancher_docs||[]).push([[38009],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>h});var n=r(67294);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i=n.createContext({}),u=function(e){var t=n.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},c=function(e){var t=u(e.components);return n.createElement(i.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},p=n.forwardRef((function(e,t){var r=e.components,o=e.mdxType,s=e.originalType,i=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),p=u(r),h=o,b=p["".concat(i,".").concat(h)]||p[h]||d[h]||s;return r?n.createElement(b,a(a({ref:t},c),{},{components:r})):n.createElement(b,a({ref:t},c))}));function h(e,t){var r=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var s=r.length,a=new Array(s);a[0]=p;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:o,a[1]=l;for(var u=2;u<s;u++)a[u]=r[u];return n.createElement.apply(null,a)}return n.createElement.apply(null,r)}p.displayName="MDXCreateElement"},74091:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>l,toc:()=>u});var n=r(87462),o=(r(67294),r(3905));const s={title:"Roles for Nodes in Kubernetes"},a=void 0,l={unversionedId:"how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/roles-for-nodes-in-kubernetes",id:"version-2.0-2.4/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/roles-for-nodes-in-kubernetes",title:"Roles for Nodes in Kubernetes",description:"This section describes the roles for etcd nodes, controlplane nodes, and worker nodes in Kubernetes, and how the roles work together in a cluster.",source:"@site/versioned_docs/version-2.0-2.4/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/roles-for-nodes-in-kubernetes.md",sourceDirName:"how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters",slug:"/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/roles-for-nodes-in-kubernetes",permalink:"/v2.0-v2.4/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/roles-for-nodes-in-kubernetes",draft:!1,editUrl:"https://github.com/rancher/rancher-docs/edit/main/versioned_docs/version-2.0-2.4/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/roles-for-nodes-in-kubernetes.md",tags:[],version:"2.0-2.4",lastUpdatedAt:1667008130,formattedLastUpdatedAt:"Oct 29, 2022",frontMatter:{title:"Roles for Nodes in Kubernetes"},sidebar:"tutorialSidebar",previous:{title:"Recommended Cluster Architecture",permalink:"/v2.0-v2.4/how-to-guides/new-user-guides/kubernetes-clusters-in-rancher-setup/checklist-for-production-ready-clusters/recommended-cluster-architecture"},next:{title:"Setting up Clusters from Hosted Kubernetes Providers",permalink:"/v2.0-v2.4/pages-for-subheaders/set-up-clusters-from-hosted-kubernetes-providers"}},i={},u=[{value:"etcd",id:"etcd",level:2},{value:"controlplane",id:"controlplane",level:2},{value:"kube-apiserver",id:"kube-apiserver",level:3},{value:"kube-controller-manager",id:"kube-controller-manager",level:3},{value:"kube-scheduler",id:"kube-scheduler",level:3},{value:"worker",id:"worker",level:2},{value:"References",id:"references",level:2}],c={toc:u};function d(e){let{components:t,...s}=e;return(0,o.kt)("wrapper",(0,n.Z)({},c,s,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"This section describes the roles for etcd nodes, controlplane nodes, and worker nodes in Kubernetes, and how the roles work together in a cluster."),(0,o.kt)("p",null,"This diagram is applicable to Kubernetes clusters ",(0,o.kt)("a",{parentName:"p",href:"/v2.0-v2.4/pages-for-subheaders/launch-kubernetes-with-rancher"},"launched with Rancher using RKE."),"."),(0,o.kt)("p",null,(0,o.kt)("img",{alt:"Cluster diagram",src:r(56492).Z,width:"772",height:"1145"}),(0,o.kt)("br",null)),(0,o.kt)("sup",null,"Lines show the traffic flow between components. Colors are used purely for visual aid"),(0,o.kt)("h2",{id:"etcd"},"etcd"),(0,o.kt)("p",null,"Nodes with the ",(0,o.kt)("inlineCode",{parentName:"p"},"etcd")," role run etcd, which is a consistent and highly available key value store used as Kubernetes\u2019 backing store for all cluster data. etcd replicates the data to each node."),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},(0,o.kt)("strong",{parentName:"p"},"Note:")," Nodes with the ",(0,o.kt)("inlineCode",{parentName:"p"},"etcd")," role are shown as ",(0,o.kt)("inlineCode",{parentName:"p"},"Unschedulable")," in the UI, meaning no pods will be scheduled to these nodes by default.")),(0,o.kt)("h2",{id:"controlplane"},"controlplane"),(0,o.kt)("p",null,"Nodes with the ",(0,o.kt)("inlineCode",{parentName:"p"},"controlplane")," role run the Kubernetes master components (excluding ",(0,o.kt)("inlineCode",{parentName:"p"},"etcd"),", as it's a separate role). See ",(0,o.kt)("a",{parentName:"p",href:"https://kubernetes.io/docs/concepts/overview/components/#master-components"},"Kubernetes: Master Components")," for a detailed list of components."),(0,o.kt)("blockquote",null,(0,o.kt)("p",{parentName:"blockquote"},(0,o.kt)("strong",{parentName:"p"},"Note:")," Nodes with the ",(0,o.kt)("inlineCode",{parentName:"p"},"controlplane")," role are shown as ",(0,o.kt)("inlineCode",{parentName:"p"},"Unschedulable")," in the UI, meaning no pods will be scheduled to these nodes by default.")),(0,o.kt)("h3",{id:"kube-apiserver"},"kube-apiserver"),(0,o.kt)("p",null,"The Kubernetes API server (",(0,o.kt)("inlineCode",{parentName:"p"},"kube-apiserver"),") scales horizontally. Each node with the role ",(0,o.kt)("inlineCode",{parentName:"p"},"controlplane")," will be added to the NGINX proxy on the nodes with components that need to access the Kubernetes API server. This means that if a node becomes unreachable, the local NGINX proxy on the node will forward the request to another Kubernetes API server in the list."),(0,o.kt)("h3",{id:"kube-controller-manager"},"kube-controller-manager"),(0,o.kt)("p",null,"The Kubernetes controller manager uses leader election using an endpoint in Kubernetes. One instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"kube-controller-manager")," will create an entry in the Kubernetes endpoints and updates that entry in a configured interval. Other instances will see an active leader and wait for that entry to expire (for example, when a node is unresponsive)."),(0,o.kt)("h3",{id:"kube-scheduler"},"kube-scheduler"),(0,o.kt)("p",null,"The Kubernetes scheduler uses leader election using an endpoint in Kubernetes. One instance of the ",(0,o.kt)("inlineCode",{parentName:"p"},"kube-scheduler")," will create an entry in the Kubernetes endpoints and updates that entry in a configured interval. Other instances will see an active leader and wait for that entry to expire (for example, when a node is unresponsive)."),(0,o.kt)("h2",{id:"worker"},"worker"),(0,o.kt)("p",null,"Nodes with the ",(0,o.kt)("inlineCode",{parentName:"p"},"worker")," role run the Kubernetes node components. See ",(0,o.kt)("a",{parentName:"p",href:"https://kubernetes.io/docs/concepts/overview/components/#node-components"},"Kubernetes: Node Components")," for a detailed list of components."),(0,o.kt)("h2",{id:"references"},"References"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://kubernetes.io/docs/concepts/overview/components/#node-components"},"Kubernetes: Node Components"))))}d.isMDXComponent=!0},56492:(e,t,r)=>{r.d(t,{Z:()=>n});const n=r.p+"assets/images/clusterdiagram-2b66ee124fed594265b3bc07fa1f145d.svg"}}]);