{"id":3389,"date":"2024-02-11T17:52:12","date_gmt":"2024-02-11T17:52:12","guid":{"rendered":"https:\/\/code2deploy.com\/?p=3389"},"modified":"2024-02-20T20:09:18","modified_gmt":"2024-02-20T20:09:18","slug":"how-to-work-the-kube-scheduler","status":"publish","type":"post","link":"https:\/\/code2deploy.com\/blog\/how-to-work-the-kube-scheduler\/","title":{"rendered":"How to work the kube-scheduler\u00a0"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Kubernetes Scheduler (kube-scheduler) is responsible for assigning pods to nodes in the cluster based on various factors such as resource requirements, affinity\/anti-affinity rules, node capacity, and user-defined constraints. Here&#8217;s how the kube-scheduler works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pod Creation Request:<\/strong> When a user submits a request to create a pod, either through the Kubernetes API server or via a higher-level resource such as a Deployment or ReplicaSet, the request is initially received by the kube-API Server.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pod Information:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The kube-API Server forwards the pod creation request to the kube-scheduler component.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Scheduling Decision:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The kube-scheduler evaluates various factors to determine the best node for placing the pod. These factors include:\n<ul class=\"wp-block-list\">\n<li>Resource requirements: CPU and memory requests\/limits specified in the pod&#8217;s configuration.<\/li>\n\n\n\n<li>Node affinity\/anti-affinity rules: Constraints that dictate pod placement based on node labels or other attributes.<\/li>\n\n\n\n<li>Pod tolerations: Specifications that allow pods to be scheduled on nodes with certain taints.<\/li>\n\n\n\n<li>Node capacity: The available resources (CPU, memory) on each node in the cluster.<\/li>\n\n\n\n<li>Pod inter-dependencies: Requirements for co-locating or spreading pods across different nodes.<\/li>\n\n\n\n<li>Custom scheduling policies: User-defined rules or preferences for pod placement.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Node Selection:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Based on the evaluation of these factors, the kube-scheduler selects the most suitable node for placing the pod.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Binding:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Once a node is selected, the <strong>kube-scheduler<\/strong> updates the pod&#8217;s configuration to specify the selected node as its target node. This process is known as &#8220;binding.&#8221;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Communication:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The kube-scheduler communicates the scheduling decision back to the kube-API Server.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pod Deployment:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The <strong>kube-API<\/strong> Server updates the pod&#8217;s configuration in the <strong>ETCD <\/strong>cluster to reflect the scheduling decision.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Pod Creation:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The <strong>kubelet <\/strong>running on the selected <strong>node<\/strong> receives the pod&#8217;s configuration from the <strong>kube-API Server.<\/strong><\/li>\n\n\n\n<li>The <strong>kubelet<\/strong> pulls the required container images, creates the pod, and starts the containers on the<strong> node.<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Status Update:<\/strong>\n<ul class=\"wp-block-list\">\n<li>Once the pod is successfully deployed on the node, the <strong>kubelet<\/strong> updates the pod&#8217;s status in the ETCD cluster via the kube-API Server.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Continuous Monitoring:<\/strong>\n<ul class=\"wp-block-list\">\n<li>The <strong>kube-scheduler<\/strong> continuously monitors the cluster for new <strong>pod<\/strong> creation requests and repeats the scheduling process as needed.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By following this process, the kube-scheduler ensures efficient and optimal utilization of cluster resources while meeting the requirements and constraints specified by users and administrators.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Kubernetes Scheduler (kube-scheduler) is responsible for assigning pods to nodes in the cluster based on various factors such as resource requirements, affinity\/anti-affinity rules, node capacity, and user-defined constraints. Here&#8217;s how the kube-scheduler works: By following this process, the kube-scheduler ensures efficient and optimal utilization of cluster resources while meeting the requirements and constraints specified [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9,13],"tags":[25,10,11,29,30,14],"class_list":["post-3389","post","type-post","status-publish","format-standard","hentry","category-devops-tools","category-kubernetes","category-orchestration-k8s","tag-cka","tag-kubernetes","tag-kubernetes-deployment","tag-sre","tag-vendor-certification","tag-workflow"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to work the kube-scheduler\u00a0 - code2deploy.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to work the kube-scheduler\u00a0 - code2deploy.com\" \/>\n<meta property=\"og:description\" content=\"The Kubernetes Scheduler (kube-scheduler) is responsible for assigning pods to nodes in the cluster based on various factors such as resource requirements, affinity\/anti-affinity rules, node capacity, and user-defined constraints. Here&#8217;s how the kube-scheduler works: By following this process, the kube-scheduler ensures efficient and optimal utilization of cluster resources while meeting the requirements and constraints specified [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/\" \/>\n<meta property=\"og:site_name\" content=\"code2deploy.com\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-11T17:52:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-20T20:09:18+00:00\" \/>\n<meta name=\"author\" content=\"enam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"enam\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/\"},\"author\":{\"name\":\"enam\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\"},\"headline\":\"How to work the kube-scheduler\u00a0\",\"datePublished\":\"2024-02-11T17:52:12+00:00\",\"dateModified\":\"2024-02-20T20:09:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/\"},\"wordCount\":369,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\"},\"keywords\":[\"CKA\",\"kubernetes\",\"Kubernetes deployment\",\"SRE\",\"Vendor Certification\",\"workflow\"],\"articleSection\":[\"DevOps Tools\",\"Kubernetes\",\"Orchestration\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/\",\"url\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/\",\"name\":\"How to work the kube-scheduler\u00a0 - code2deploy.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#website\"},\"datePublished\":\"2024-02-11T17:52:12+00:00\",\"dateModified\":\"2024-02-20T20:09:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.code2deploy.com\\\/how-to-work-the-kube-scheduler\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to work the kube-scheduler\u00a0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/\",\"name\":\"code2deploy.com\\\/blog\",\"description\":\"TechOps\",\"publisher\":{\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/#\\\/schema\\\/person\\\/e46930c19b999a87f12566fa8357481b\",\"name\":\"enam\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\",\"caption\":\"enam\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g\"},\"sameAs\":[\"https:\\\/\\\/code2deploy.com\\\/blog\"],\"url\":\"https:\\\/\\\/code2deploy.com\\\/blog\\\/author\\\/enam\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to work the kube-scheduler\u00a0 - code2deploy.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/","og_locale":"en_US","og_type":"article","og_title":"How to work the kube-scheduler\u00a0 - code2deploy.com","og_description":"The Kubernetes Scheduler (kube-scheduler) is responsible for assigning pods to nodes in the cluster based on various factors such as resource requirements, affinity\/anti-affinity rules, node capacity, and user-defined constraints. Here&#8217;s how the kube-scheduler works: By following this process, the kube-scheduler ensures efficient and optimal utilization of cluster resources while meeting the requirements and constraints specified [&hellip;]","og_url":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/","og_site_name":"code2deploy.com","article_published_time":"2024-02-11T17:52:12+00:00","article_modified_time":"2024-02-20T20:09:18+00:00","author":"enam","twitter_card":"summary_large_image","twitter_misc":{"Written by":"enam","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/#article","isPartOf":{"@id":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/"},"author":{"name":"enam","@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b"},"headline":"How to work the kube-scheduler\u00a0","datePublished":"2024-02-11T17:52:12+00:00","dateModified":"2024-02-20T20:09:18+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/"},"wordCount":369,"commentCount":0,"publisher":{"@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b"},"keywords":["CKA","kubernetes","Kubernetes deployment","SRE","Vendor Certification","workflow"],"articleSection":["DevOps Tools","Kubernetes","Orchestration"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/","url":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/","name":"How to work the kube-scheduler\u00a0 - code2deploy.com","isPartOf":{"@id":"https:\/\/code2deploy.com\/blog\/#website"},"datePublished":"2024-02-11T17:52:12+00:00","dateModified":"2024-02-20T20:09:18+00:00","breadcrumb":{"@id":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.code2deploy.com\/how-to-work-the-kube-scheduler\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code2deploy.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to work the kube-scheduler\u00a0"}]},{"@type":"WebSite","@id":"https:\/\/code2deploy.com\/blog\/#website","url":"https:\/\/code2deploy.com\/blog\/","name":"code2deploy.com\/blog","description":"TechOps","publisher":{"@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code2deploy.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/code2deploy.com\/blog\/#\/schema\/person\/e46930c19b999a87f12566fa8357481b","name":"enam","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g","caption":"enam"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/d864e2f082f4499f8f1b33f004ec166eea77b9e94738553b120b6dca2410f203?s=96&d=mm&r=g"},"sameAs":["https:\/\/code2deploy.com\/blog"],"url":"https:\/\/code2deploy.com\/blog\/author\/enam\/"}]}},"_links":{"self":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts\/3389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/comments?post=3389"}],"version-history":[{"count":1,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts\/3389\/revisions"}],"predecessor-version":[{"id":3505,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/posts\/3389\/revisions\/3505"}],"wp:attachment":[{"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/media?parent=3389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/categories?post=3389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code2deploy.com\/blog\/wp-json\/wp\/v2\/tags?post=3389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}