{"id":200631,"date":"2021-03-12T18:00:57","date_gmt":"2021-03-12T15:00:57","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-does-kubernetes-work-cloudsavvy-it\/"},"modified":"2021-03-12T18:00:57","modified_gmt":"2021-03-12T15:00:57","slug":"how-does-kubernetes-work-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-does-kubernetes-work-cloudsavvy-it\/","title":{"rendered":"#How Does Kubernetes Work? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2db7d5c64c3\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2db7d5c64c3\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-does-kubernetes-work-cloudsavvy-it\/#Defining_the_Cluster\" >Defining the Cluster<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-does-kubernetes-work-cloudsavvy-it\/#Role_of_the_Control_Plane\" >Role of the Control Plane<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-does-kubernetes-work-cloudsavvy-it\/#Communication_Between_Nodes_and_the_Control_Plane\" >Communication Between Nodes and the Control Plane<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-does-kubernetes-work-cloudsavvy-it\/#What_Else_Do_Nodes_Run\" >What Else Do Nodes Run?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-does-kubernetes-work-cloudsavvy-it\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How Does Kubernetes Work? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-9632\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/06268c7060f33c17d0b8db5f1f90faf9\/p\/uploads\/2021\/02\/748108a6.jpg\" alt=\"Graphic showing the Kubernetes logo\" width=\"1602\" height=\"902\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Kubernetes is a container orchestration platform that automates the deployment and scaling of containerized workloads. Kubernetes has gained a reputation for being complex and unwieldy. Here\u2019s how individual components combine to form a cluster.<\/p>\n<h2 id=\"defining-the-cluster\"><span class=\"ez-toc-section\" id=\"Defining_the_Cluster\"><\/span>Defining the Cluster<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A single Kubernetes installation is termed a \u201ccluster.\u201d Within the cluster, there are one or more Nodes available to run your containers. A <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/architecture\/nodes\">Node<\/a> is a representation of a physical machine that has been joined to the cluster.<\/p>\n<p>Kubernetes also has a <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/reference\/glossary\/?all=true#term-control-plane\">Control Plane<\/a> surface. This functions independently of the worker Nodes. The Control Plane is what you interact with. It exposes the Kubernetes API and is responsible for managing the worker Nodes. You don\u2019t usually directly manipulate the Nodes and their workloads.<\/p>\n<p>Instructing Kubernetes to create a workload starts with an API call to the Control Plane. The Control Plane then determines the Node(s) that your containers should be scheduled to. No matter how many Nodes you have, there\u2019ll only ever be one Control Plane within your cluster.<\/p>\n<h2 id=\"role-of-the-control-plane\"><span class=\"ez-toc-section\" id=\"Role_of_the_Control_Plane\"><\/span>Role of the Control Plane<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>More broadly, the Control Plane is responsible for the global management of your cluster. Any operation that could affect multiple Nodes or the cluster infrastructure will be managed by the Control Plane.<\/p>\n<p>The Control Plane consists of several independent components. Together, they\u2019re responsible for managing cluster configuration, running and scaling workloads, and reacting to events within the cluster (such as a Node running out of memory).<\/p>\n<p>The core of the Control Plane is <strong>kube-apiserver<\/strong>. This component provides the Kubernetes HTTP API that you consume through tools like Kubectl and Helm. The API is how you interact with your cluster. It\u2019s also used by other cluster components, such as Node worker processes, to relay information back to the Control Plane.<\/p>\n<p>Resources in your cluster\u2014such as Pods, Services, and Jobs\u2014are managed by individual <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/architecture\/controller\">\u201ccontrollers<\/a>.\u201d Controllers monitor their resources for healthiness and readiness. They also identify changes that have been requested and then take steps to migrate the current state into the newly desired state.<\/p>\n<p>Controllers are managed in aggregate by <strong>kube-controller-manager<\/strong>. This Control Plane component starts and runs the individual controllers. This process will always be running. Were it ever to stop, changes made through the API server would not be identified, and no state changes would ever occur.<\/p>\n<p>Another critical Control Plane component is <strong>kube-scheduler<\/strong>. The scheduler is responsible for assigning Pods to Nodes. Scheduling usually requires consideration of several different parameters, such as the current resource usage of each Node and any constraints you\u2019ve enforced in your manifest.<\/p>\n<p>The scheduler will assess each Node\u2019s suitability and then delegate the Pod to run on the most <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ropriate Node. If Node availability changes or more replicas of a Pod are requested, the scheduler will take action to reschedule the workload accordingly.<\/p>\n<p>The entire Control Plane usually runs on a single Node within the cluster. It is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/setup\/production-environment\/tools\/kubeadm\/high-availability\">technically possible<\/a> to span the Control Plane across multiple Nodes. This helps to maximize its availability.<\/p>\n<p>Ordinarily, loss of the Control Plane leaves you unable to manage your cluster, as the API and scheduling functions go offline. Pods on worker Nodes will keep running, though\u2014they\u2019ll periodically attempt reconnection to the Control Plane.<\/p>\n<h2 id=\"communication-between-nodes-and-the-control-plane\"><span class=\"ez-toc-section\" id=\"Communication_Between_Nodes_and_the_Control_Plane\"><\/span>Communication Between Nodes and the Control Plane<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Kubernetes maintains a two-way <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/architecture\/control-plane-node-communication\">communication channel<\/a> between Nodes and the Control Plane.<\/p>\n<p>Communication is necessary so that the Control Plane can instruct Nodes to create new containers. In the opposite direction, Nodes need to feed data about their availability (such as resource usage statistics) back to the Control Plane. This ensures that Kubernetes can make informed decisions when scheduling containers.<\/p>\n<p>All worker Nodes run an instance of <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/reference\/command-line-tools-reference\/kubelet\">kubelet<\/a>. This is an agent utility responsible for maintaining communication with the Kubernetes Control Plane. Kubelet also continually monitors the containers that the Node is running. It\u2019ll notify the Control Plane if a container drops into an unhealthy state.<\/p>\n<p>When a Node needs to send data to the Control Plane, Kubelet connects to the Control Plane\u2019s API server. This uses the same HTTPS interface that you connect to through tools like kubectl. Kubelet is preconfigured with credentials that allow it to authenticate to Kubernetes.<\/p>\n<p>Traffic from the Control Plane to Nodes is again handled using kubelet. Kubelet exposes its own HTTPS endpoint that the Control Plane can access. This endpoint accepts new container manifests, which kubelet then uses to adjust the running containers.<\/p>\n<h2 id=\"what-else-do-nodes-run\"><span class=\"ez-toc-section\" id=\"What_Else_Do_Nodes_Run\"><\/span>What Else Do Nodes Run?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Kubelet isn\u2019t the only binary that a Kubernetes Node must run. You\u2019ll also find an instance of <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/reference\/command-line-tools-reference\/kube-proxy\">kube-proxy<\/a> on each Node. This is responsible for configuring the Node\u2019s networking system to meet the requirements of your container workloads.<\/p>\n<p>Kubernetes has the concept of <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/service\">\u201cservices,\u201d<\/a> which expose multiple Pods as a single network identity. It\u2019s kube-proxy that converts service definitions into the networking rules that provide the access you requested.<\/p>\n<p>kube-proxy configures the operating system\u2019s networking infrastructure to expose services created by kubelet. Traffic forwarding is handled either by the OS-level packet filtering layer or by kube-proxy itself.<\/p>\n<p>Besides kubelet and kube-proxy, Nodes also need to have a container runtime available. The container runtime is responsible for pulling images and actually running your containers. Kubernetes supports any runtime implementing its <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/kubernetes\/community\/blob\/master\/contributors\/devel\/sig-node\/container-runtime-interface.md\">Container Runtime Interface<\/a> specification. Examples include containerd and CRI-O.<\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Kubernetes involves a lot of terminology. Breaking clusters down into their constituent parts can help you appreciate how the individual components interlink.<\/p>\n<p>The Control Plane sits above all the Nodes and is responsible for managing the cluster\u2019s operations. The Nodes are best viewed as equals directly below the Control Plane. There is continuous back-and-forth communication between the Nodes and the Control Plane. You, as a user, only interact with the Control Plane via the API server.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-10105\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/f15d23b2748b3e21410cfd7a07e9ba6d\/p\/uploads\/2021\/03\/a34ae084.png\" alt=\"Graphic showing Kubernetes cluster architecture\" width=\"1067\" height=\"513\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The Control Plane is therefore the hub of your cluster. You don\u2019t usually engage with Nodes directly. Instead, you send instructions to the Control Plane, which then creates appropriate schedules to fulfill your request. Workloads only get scheduled to Nodes when the Control Plane sends a container manifest to one of the available kubelet instances.<\/p>\n<p>When a Node receives a new manifest, it will use its container runtime to pull the appropriate image and start a new container instance. kube-proxy will then modify the networking configuration to set up services and make your workload accessible. Kubelet relays data about the Node\u2019s health back to Kubernetes, enabling it to take action to reschedule Pods if Node resources become constrained.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/10110\/how-does-kubernetes-work\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How Does Kubernetes Work? \u2013 CloudSavvy IT&#8221; Kubernetes is a container orchestration platform that automates the deployment and scaling of containerized workloads. Kubernetes has gained a reputation for being complex and unwieldy. Here\u2019s how individual components combine to form a cluster. Defining the Cluster A single Kubernetes installation is termed a \u201ccluster.\u201d Within the cluster,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":200632,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/02\/748108a6.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-200631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/200631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=200631"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/200631\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/200632"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=200631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=200631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=200631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}