{"id":80560,"date":"2022-01-12T22:09:47","date_gmt":"2022-01-13T03:39:47","guid":{"rendered":"https:\/\/www.whizlabs.com\/blog\/?p=80560"},"modified":"2022-01-17T02:57:57","modified_gmt":"2022-01-17T08:27:57","slug":"kubectl-imperative-commands-kubernetes","status":"publish","type":"post","link":"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/","title":{"rendered":"Top 15 Important Kubectl Imperative Commands in Kubernetes [CHEAT SHEET]"},"content":{"rendered":"<p>In this article, we are going to learn about the top 15 most important <strong>Kubectl Imperative commands<\/strong> used in the Kubernetes system which manages containers used to build applications. Kubectl commands are helpful in carrying out the HTTP requests to the Kubernetes API.<\/p>\n<p>Before learning the Kubectl commands, you should know about the basics of Kubectl, where it is used, and how it works.\u00a0If you want to try out the Kubernetes platform practically for passing the <a href=\"https:\/\/www.whizlabs.com\/certified-kubernetes-administrator\/\">Kubernetes Certification Exam<\/a>, then first start learning these Kubectl commands.<\/p>\n<p>Kubernetes is one of the most popular open-source platforms working in a container orchestration system. Kubernetes are helpful in auto-scaling the applications, enabling operational codes, automating the deployment of software applications and management.\u00a0Kubernetes can run on any popular cloud service providers such as Amazon AWS, Microsoft Azure, and Google cloud. Also, it can be installed on any operating system like Linux, Windows, and macOS.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #ea7e02;color:#ea7e02\" 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: #ea7e02;color:#ea7e02\" 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><\/span><\/a><\/span><\/div>\n<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:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#What_is_Kubectl\" >What is Kubectl?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#Declarative\" >Declarative<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#Imperative\" >Imperative<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#Kubectl_cheat_sheet_to_execute_Imperative_commands\" >Kubectl cheat sheet to execute Imperative commands<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#Final_words\" >Final words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#References\" >References<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.whizlabs.com\/blog\/kubectl-imperative-commands-kubernetes\/#Summary\" >Summary<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_is_Kubectl\"><\/span><span style=\"font-weight: 400;\">What is Kubectl?<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Kubectl stands for &#8220;Kubernetes Command-line interface&#8221;. It is a command-line tool for the Kubernetes platform to perform API calls. <span style=\"font-weight: 400;\">Kubectl is the main interface that allows users to create (and manage) individual objects or groups of objects inside a Kubernetes cluster. <\/span><\/p>\n<p>As a user, Kubectl helps you to control Kubernetes as a cockpit. Every operation in Kubernetes can be controlled by a user with the help of kubectl commands. In technical, the same kubectl acts as a client for Kubernetes API.<\/p>\n<p><em>Here&#8217;s how Kubectl sends HTTP requests to the Kubernetes API<\/em><\/p>\n<figure id=\"attachment_80842\" aria-describedby=\"caption-attachment-80842\" style=\"width: 1024px\" class=\"wp-caption alignnone\"><img decoding=\"async\" class=\"wp-image-80842 size-large\" title=\"kubectl kubernetes api\" src=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-1024x685.jpg\" alt=\"kubectl kubernetes api\" width=\"1024\" height=\"685\" srcset=\"https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-1024x685.jpg 1024w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-300x201.jpg 300w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-768x514.jpg 768w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-1536x1028.jpg 1536w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-2048x1371.jpg 2048w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-627x420.jpg 627w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-537x360.jpg 537w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-640x428.jpg 640w, https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/kubectl-kubernetes-api-681x456.jpg 681w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption id=\"caption-attachment-80842\" class=\"wp-caption-text\">Source: www.dockerlabs.collabnix.com<\/figcaption><\/figure>\n<p><span style=\"font-weight: 400;\">It provides users access to all the different operations such as creation, updation, deletion of objects. <\/span><span style=\"font-weight: 400;\">It can be used to do these operations in two ways &#8211; Imperative &amp; Declarative commands. <\/span><span style=\"font-weight: 400;\">From the perspective of the Kubernetes certification exam, understanding declarative and imperative commands are very important to pass the certification exam.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let&#8217;s see what they are.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Declarative\"><\/span><span style=\"font-weight: 400;\">Declarative<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Declarative Commands are used for creating resources from manifest files using the &#8216;kubectl apply&#8217; or &#8216;kubectl create&#8217; command. This is a method commonly used in CICD pipelines where YAMLs usually present.<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Imperative\"><\/span><span style=\"font-weight: 400;\">Imperative<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Imperative commands are used to create, update and delete objects on Kubernetes clusters without having to specify any manifest files beforehand. They are a godsend for Kubernetes application developers and administrators because they are very easy to remember and let you get things done more efficiently!<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Kubectl_cheat_sheet_to_execute_Imperative_commands\"><\/span>Kubectl cheat sheet to execute Imperative commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">This Kubectl cheat sheet goes through several commonly used important imperative commands. <\/span><span style=\"font-weight: 400;\">Do a lot of practice with these Kubectl commands as a part of preparing for <a href=\"https:\/\/www.whizlabs.com\/blog\/kubernetes-certifications\/\">Kubernetes certifications<\/a><\/span><\/p>\n<ol>\n<li>Creation of pods-\n<pre>kubectl run &lt;pod-name&gt; --image=&lt;image-name&gt;\r\n\r\ne.g. kubectl run nginx --image=nginx<\/pre>\n<\/li>\n<li>Creation of config maps-\n<pre>kubectl create cm &lt;configmap-name&gt; --from-literal=&lt;key&gt;=&lt;value&gt;\r\nkubeclt create cm &lt;configmap-name&gt; --from-file=&lt;file-name&gt;\r\n\r\ne.g.\r\nkubectl create cm website --from-literal=name=whizlabs\r\nkubectl create cm exams --from-literal=whizlabs.txt<\/pre>\n<p>3. Creation of secrets-<\/p>\n<pre>kubectl create secret generic &lt;secret-name&gt; --from-literal=&lt;key&gt;=&lt;value&gt;\r\nkubectl create secret generic &lt;secret-name&gt; --from-file=&lt;file-name&gt;\r\n\r\ne.g.\r\nkubectl create secret website --from-literal=name=whizlabs\r\nkubectl create secret exams --from-literal=whizlabs.txt'\r\n\r\n<\/pre>\n<p>4. Creation of deployments-<\/p>\n<pre>kubectl create deployment &lt;deployment-name&gt; --image=&lt;image-name&gt;\u00a0\r\nkubectl create deployment &lt;deployment-name&gt; --image=&lt;image-name&gt; --replicas=&lt;replica-count&gt;\r\n\r\ne.g. \r\nkubectl create deployment nginx --image=nginx\u00a0\r\nkubectl create deployment ubuntu --image=ubuntu --replicas=3<\/pre>\n<p>5. Modify properties of an existing deployment-<\/p>\n<pre>kubectl scale deployment &lt;deployment-name&gt; --replicas=&lt;new-replica-count&gt;\r\nkubectl set image deployment &lt;deployment-name&gt; &lt;name-of-container&gt;=&lt;new-image-name&gt;\r\n\r\ne.g. \r\nkubectl scale deployment nginx --replicas=3\r\nkubectl set image deployment ubuntu ubuntu=ubuntu:16<\/pre>\n<p>6. Performing rollout actions on existing deployment-<\/p>\n<pre>kubectl rollout status deployment &lt;deployment-name&gt;\r\nkubectl rollout history deployment &lt;deployment-name&gt;\r\nkubectl rollout undo deployment &lt;deployment-name&gt; --to-revision=&lt;revision-number&gt;\r\n\r\ne.g. \r\nkubectl rollout status deployment nginx\r\nkubectl rollout history deployment nginx\r\nkubectl rollout undo deployment nginx --to-revision=2<\/pre>\n<p>7. Creating services for exposing deployments-<\/p>\n<pre>kubectl expose deployment &lt;deployment-name&gt; --type=&lt;svc-type&gt; --port=&lt;port-number&gt; --target-port=&lt;target-port-number&gt; --name=&lt;svc-name&gt;\r\n\r\ne.g.\r\nkubectl expose deployment nginx --type=ClusterIP --port=8080 --target-port=80 --name=nginx-clusterip-svc\r\nkubectl expose deployment ubuntu --type=NodePort --port=8080 --target-port=80 --name=nginx-nodeport-svc<\/pre>\n<p>8. Creating pods with additional properties-<\/p>\n<pre>kubectl run &lt;pod-name&gt; --image=&lt;image-name&gt; --requests=cpu=&lt;cpu-requests&gt;,memory=&lt;memory-requests&gt; --limits=cpu=&lt;cpu-limits&gt;,memory=&lt;memory-limits&gt;\r\n\r\ne.g.\u00a0kubectl run alpine --image=alpine --requests=cpu=200m,memory=256Mi --limits=cpu=400m,memory=512Mi<\/pre>\n<p>9. Creating deployment objects with additional properties<\/p>\n<pre>kubectl create deployment &lt;deployment-name&gt; --image=&lt;image-name&gt; --replicas=&lt;replica-count&gt; -- &lt;command&gt;\u00a0 &lt;arguments&gt;\r\nkubectl create deployment &lt;deployment-name&gt; --image=&lt;image-name&gt; --replicas=&lt;replica-count&gt; --port=&lt;port-to-expose&gt;\r\n\r\ne.g.\r\nkubectl create deployment ubuntu --image=ubuntu --replicas=2 -- sleep 500\r\nkubectl create deployment nginx --image=nginx --replicas=3 --port=80<\/pre>\n<p>10. Creating jobs and crons-<\/p>\n<pre>kubectl create job &lt;job-name&gt; --image=&lt;image-name&gt; -- &lt;command&gt; &lt;arguments&gt;\r\nkubectl create cronjob &lt;job-name&gt; --image=&lt;image-name&gt; --schedule=\"&lt;cron-schedule&gt;\"\u00a0 -- &lt;command&gt; &lt;arguments&gt;\r\n\r\ne.g.\r\nkubectl create job whizlab --image=ubuntu -- sleep 200\r\nkubectl create cronjob whizlabs --image=ubuntu --schedule=\"* * * * *\" -- sleep 300<\/pre>\n<p>11. Performing action related to annotations<\/p>\n<pre>To add:\r\nkubectl annotate pods &lt;podname&gt; &lt;key&gt;=&lt;value&gt;\r\ne.g.\r\n<span style=\"font-weight: 400;\">kubectl annotate pods nginx prepareon='whizlabs'\r\n<\/span><span style=\"font-weight: 400;\">\r\nTo remove:\r\nkubectl annotate pods &lt;podname&gt; &lt;key&gt;-\r\ne.g.\r\nkubectl annotate pods nginx prepareon-\r\n\r\nTo overwrite:\r\nkubectl annotate pods &lt;podname&gt; &lt;key&gt;=&lt;new-value&gt; --overwrite\r\ne.g.\u00a0\r\nkubectl annotate pods nginx prepareon='Whizlabz' --overwrite\r\n<\/span><\/pre>\n<p>12. Performing actions related to labeling<\/p>\n<pre>To add:\r\nkubectl label pods &lt;podname&gt; &lt;key&gt;=&lt;value&gt;\r\ne.g.\r\nkubectl label pods nginx prepareon='whizlabs'\r\n\r\nTo remove:\r\nkubectl label pods &lt;podname&gt; &lt;key&gt;-\r\ne.g.\r\nkubectl label pods nginx prepareon-\r\n\r\nTo overwrite:\r\nkubectl label pods &lt;podname&gt; &lt;key&gt;=&lt;new-value&gt; --overwrite\r\ne.g.\r\nkubectl label pods nginx prepareon='Whizlabz' --overwrite<\/pre>\n<p>13. Create a service account<\/p>\n<pre><span style=\"font-weight: 400;\">kubectl create sa &lt;serviceaccount-name&gt;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">e.g. kubectl create sa whizlabs\r\n<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">14. Create roles<\/span><\/p>\n<pre>kubectl create role &lt;role-name&gt; --verb=&lt;list-of-verbs&gt; --resources=&lt;list-of-resource&gt;\r\n<span style=\"font-weight: 400;\">kubectl create clusterrole &lt;clusterrole-name&gt; --verb=&lt;list-of-verbs&gt; --resources=&lt;list-of-resource&gt;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">e.g.\r\n<\/span><span style=\"font-weight: 400;\">kubectl create role role123 --verb=get,list --resources=pods,services\r\n<\/span><span style=\"font-weight: 400;\">kubectl create clusterrole clusterrole123 --verb=get,list --resources=pods,services<\/span><\/pre>\n<p>15. Create role bindings<\/p>\n<pre>kubectl create rolebinding &lt;rolebinding-name&gt; --role=&lt;role-name&gt; --serviceaccount=&lt;namespace&gt;:&lt;serviceaccount-name&gt;\r\nkubectl create clusterrolebinding &lt;clusterrolebinding-name&gt; --clusterrole=&lt;role-name&gt; --serviceaccount=&lt;namespace&gt;:&lt;serviceaccount-name&gt;\r\n\r\ne.g.\r\nkubectl create rolebinding rb123 --role=role123 --serviceaccount=default:whizlabs\r\nkubectl create clusterrolebinding rb123 --role=clusterrole123 --serviceaccount=default:whizlabs<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Final_words\"><\/span>Final words<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There were the most commonly used imperative commands. Additionally, these commands are often used along &#8220;dry-run&#8221; and &#8220;output&#8221; flags to generate full-fledged YAML manifests of the Kubernetes objects. It greatly reduces the manual work for Kubernetes application developers &amp; administrators!<\/p>\n<pre>e.g.\r\nkubectl create deployment nginx <strong>--dry-run=client -o yaml<\/strong>\r\nkubectl expose deployment nginx --type=ClusterIP --port-80 --name=nginx-svc <strong>--dry-run=client -o yaml\r\n<span style=\"font-weight: 400;\">kubectl create sa whizlabs <strong>--dry-run=client -o yaml<\/strong>\r\nkubectl run alpine --image=alpine --requests=cpu=200m,memory=256Mi --limits=cpu=400m,memory=512Mi <strong>--dry-run=client -o yaml<\/strong>\r\nkubectl create role role123 --verb=get,list --resources=pods,services <strong>--dry-run=client -o yaml<\/strong>\r\nkubectl create rolebinding rb123 --role=role123 --serviceaccount=default:whizlabs <strong>--dry-run=client -o yaml<\/strong>\r\n<\/span><\/strong><\/pre>\n<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"References\"><\/span>References<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><a href=\"https:\/\/kubernetes.io\/docs\/reference\/generated\/kubectl\/kubectl-commands\" target=\"_blank\" rel=\"noopener\">Kubectl Reference Document<\/a><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>That&#8217;s all. Hope you got the list of <strong>important imperative Kubectl commands<\/strong> to communicate in HTTP REST API which is the default user interface of the Kubernetes platform. The best way to learn all these <strong>Kubectl commands<\/strong> is to try using them in the Kubernetes platform and find out the results driven by it. If you are a beginner at the Kubernetes platform, by using these commands, you can prepare for the Kubernetes certification exams practically. Keep learning!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we are going to learn about the top 15 most important Kubectl Imperative commands used in the Kubernetes system which manages containers used to build applications. Kubectl commands are helpful in carrying out the HTTP requests to the Kubernetes API. Before learning the Kubectl commands, you should know about the basics of Kubectl, where it is used, and how it works.\u00a0If you want to try out the Kubernetes platform practically for passing the Kubernetes Certification Exam, then first start learning these Kubectl commands. Kubernetes is one of the most popular open-source platforms working in a container orchestration [&hellip;]<\/p>\n","protected":false},"author":357,"featured_media":80934,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[10],"tags":[],"class_list":["post-80560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-computing-certifications"],"uagb_featured_image_src":{"full":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",600,315,false],"thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes-150x150.png",150,150,true],"medium":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes-300x158.png",300,158,true],"medium_large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",600,315,false],"large":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",600,315,false],"1536x1536":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",600,315,false],"2048x2048":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",600,315,false],"profile_24":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",24,13,false],"profile_48":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",48,25,false],"profile_96":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",96,50,false],"profile_150":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",150,79,false],"profile_300":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",300,158,false],"tptn_thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes-250x250.png",250,250,true],"web-stories-poster-portrait":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",600,315,false],"web-stories-publisher-logo":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",96,50,false],"web-stories-thumbnail":["https:\/\/www.whizlabs.com\/blog\/wp-content\/uploads\/2022\/01\/Kubectl-Imperative-Commands-in-Kubernetes.png",150,79,false]},"uagb_author_info":{"display_name":"Shishir Khandelwal","author_link":"https:\/\/www.whizlabs.com\/blog\/author\/shishir-khandelwal\/"},"uagb_comment_info":1,"uagb_excerpt":"In this article, we are going to learn about the top 15 most important Kubectl Imperative commands used in the Kubernetes system which manages containers used to build applications. Kubectl commands are helpful in carrying out the HTTP requests to the Kubernetes API. Before learning the Kubectl commands, you should know about the basics of&hellip;","_links":{"self":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/80560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/users\/357"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/comments?post=80560"}],"version-history":[{"count":31,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/80560\/revisions"}],"predecessor-version":[{"id":80935,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/posts\/80560\/revisions\/80935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media\/80934"}],"wp:attachment":[{"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/media?parent=80560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/categories?post=80560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whizlabs.com\/blog\/wp-json\/wp\/v2\/tags?post=80560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}