{"id":16216,"date":"2023-11-30T02:32:59","date_gmt":"2023-11-30T02:32:59","guid":{"rendered":"https:\/\/businessyield.com\/tech\/?p=16216"},"modified":"2023-11-30T02:33:01","modified_gmt":"2023-11-30T02:33:01","slug":"kubectl-commands","status":"publish","type":"post","link":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/","title":{"rendered":"KUBECTL COMMANDS: Everything You Need To Know","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"\n<p>If you are new to Kubernetes, it can be hard to keep track of everything. Knowing about all the different objects Kubernetes provides should be enough, right? No, it gets even more complicated for beginners when they try to interact with K8 clusters. As with Kubernetes, Kubectl is built and released as part of it, and it uses the same versioning system. Therefore, it is crucial to review the fundamentals by learning what Kubectl is, what it does, and how to run it on Windows before moving on to the cheat sheet. To help you, this article will walk you through the examples of Kubectl commands you need to know about.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-kubectl-commands-overview\"><span id=\"kubectl-commands-overview\">Kubectl commands: Overview<\/span><\/h2>\n\n\n\n<p>Kubectl is a command-line tool for Kubernetes that lets you talk to and manage Kubernetes clusters. It talks to the Kubernetes API server to do management tasks. It verifies its identity with the master node of your cluster and uses API calls to do this. Kubectl also lets you create, inspect, update, and delete Kubernetes objects, as well as deploy apps, look at and manage cluster resources, and see logs. Kubectl provides three methods.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A technique called \u201cimperative commands\u201d tells Kubernetes exactly what to do with each object, like \u201ckubectl create pod\u201d or \u201ckubectl delete service.\u201d<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The \u201cImperative Object Configuration\u201d method is the same as the first one, but it uses manifest files instead of objects directly. For example, kubectl create -f manifest.yaml is this method\u2019s command.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The \u201cDeclarative Object Configuration\u201d technique also uses manifest files as input, but it adds objects if they don\u2019t already exist or changes existing objects that don\u2019t match the manifest files\u2019 specifications. That command is kubectl apply -f manifest.yaml.<\/li>\n<\/ul>\n\n\n\n<p>In essence, this indicates that the standard object notation is an object type, a slash, and then an object name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-kubectl-commands-cheat-sheet\"><span id=\"kubectl-commands-cheat-sheet\">Kubectl Commands Cheat Sheet<\/span><\/h2>\n\n\n\n<p>Kubectl is the command-line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This cheat sheet will help you quickly run commands on a lot of common Kubernetes resources, Windows, and components.<\/p>\n\n\n\n<p>Also, you can use the full command for an object on things like pod(s) or the shortcode variation that is said in the section headings. The result will be the same for all of them. When you run most of the commands, you should also make sure to add the <name of the resource you are managing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-kubectl-commands-cheat-sheet-terms-used-in-kubernetes\"><span id=\"kubectl-commands-cheat-sheet-terms-used-in-kubernetes\">Kubectl Commands Cheat Sheet: Terms Used in Kubernetes<\/span><\/h3>\n\n\n\n<p>Some terms you should know before you start using Kubernetes have been listed below:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The cluster, as I think of it, is a group of real or virtual servers that run Kubernetes.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Node: Nodes come in two different types:<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><img decoding=\"async\" width=\"17.599999999999998px\" height=\"17.599999999999998px\" src=\"https:\/\/businessyield.com\/1d3aba4a-fa25-4b70-8d28-1394868250ec\" alt=\"unchecked\"> A master node, which can be a physical or virtual server, is in charge of managing the Kubernetes cluster.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><img decoding=\"async\" width=\"17.599999999999998px\" height=\"17.599999999999998px\" src=\"https:\/\/businessyield.com\/57b483ff-6f12-440e-8021-bee1b2842f15\" alt=\"unchecked\">The worker node is the physical or virtual server where a given container technology is used to run the workload.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pods are a set of containers that use the same namespaces on the network.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The labels: These are the key-value pairs that the user sets up and links to Pods.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Master: It manages the plane components that give administrators access to the cluster workloads.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>command-lineService: An abstraction that stands in for a group of pods doing a \u201cservice\u201d is one way to look at it.<\/li>\n<\/ul>\n\n\n\n<p>Okay, now that we have a good idea of what Kubernetes is, let\u2019s go to the cheat sheet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-kubectl-commands-cheat-sheet-nbsp-with-examples\"><span id=\"kubectl-commands-cheat-sheet-with-examples\">Kubectl Commands Cheat Sheet\u00a0With Examples<\/span><\/h3>\n\n\n\n<p>This part will list and explain each commonly used Kubernetes (K8S) category or component, along with the right Kubectl commands for quick reference!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-1-common-options\"><span id=\"1-common-options\">#1. Common Options<\/span><\/h4>\n\n\n\n<p>In Kubectl, you can specify optional flags for use with various commands.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>alias: Set an alias for Kubectl.<\/li>\n<\/ul>\n\n\n\n<p>alias k=kubectl<\/p>\n\n\n\n<p>echo \u2018alias k=kubectl\u2019 >> ~\/.bashrc<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>-o=json: Output format in JSON.<\/li>\n<\/ul>\n\n\n\n<p>kubectl get pods -o=json<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>-o=yaml: Output format in YAML.<\/li>\n<\/ul>\n\n\n\n<p>kubectl get pods -o=yaml<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>-o=wide: Output in plain-text format with any additional information, and for pods, the node name is included.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-2-files-for-configuration-also-known-as-yaml-or-manifest-files\"><span id=\"2-files-for-configuration-also-known-as-yaml-or-manifest-files\">#2. Files for Configuration (also known as YAML or Manifest Files)<\/span><\/h4>\n\n\n\n<p>Files for Configuration: Store multiple object configuration files in a directory, and use Kubectl to create and update Kubernetes objects as needed. This lets you create, update, and delete objects. In essence, there is no need to merge changes made to live objects back into the object configuration files with this method. Furthermore, Kubectl diff shows you a sneak peek of the changes that it will bring about.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl create -f <configuration file>\u00a0 Create objects.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl create -f <configuration file directory> Create objects in all manifest files in a directory.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl create -f <\u2018url\u2019> \u2013 Create objects from a URL.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl delete -f <configuration file>: Delete an object.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-3-cluster-management-and-context\"><span id=\"3-cluster-management-and-context\">#3. Cluster Management and Context<\/span><\/h4>\n\n\n\n<p>Cluster management refers to querying information about the K8S cluster itself.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl cluster-info: Display endpoint information about the master and services in the cluster.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl version: Display the Kubernetes version running on the client and server.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl config view: Get the configuration of the cluster.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-4-daemonsets\"><span id=\"4-daemonsets\">#4. Daemonsets<\/span><\/h4>\n\n\n\n<p>DaemonSets guarantees that all (or some) nodes run a copy of a pod. It is possible to add pods to nodes as they are added to the cluster. Any pods that are no longer needed are thrown away when a node is removed from the cluster. Also, cleaning up the pods that a DaemonSet made will happen when you delete them.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl gets a daemonset. List one or more daemonsets.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl edit daemonset <daemonset_name>: Edit and update the definition of one or more daemonset.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl delete daemonset <daemonset_name>: Delete a daemonset.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl create daemonset <daemonset_name> Create a new daemonset.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-5-deployments\"><span id=\"5-deployments\">#5. Deployments<\/span><\/h4>\n\n\n\n<p>A deployment gives Pods and ReplicaSets declarative updates. This is where you describe the state you want in a deployment, and at a controlled rate, the deployment controller changes the current state to the state you want. That is to say, one way to define deployments is to make new replica sets or to get rid of old deployments and use all of their resources in new ones.\u00a0<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl get deployment: List one or more deployments.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl describes deployment <deployment_name> and displays the detailed state of one or more deployments.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl edit deployment <deployment_name>: Edit and update the definition of one or more deployments on the server.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-6-logs\"><span id=\"6-logs\">#6. Logs<\/span><\/h4>\n\n\n\n<p>System component logs keep track of what\u2019s happening in the cluster and can be very helpful for fixing bugs. Hence, the log verbosity can be changed so that you see more or less information. Also, logs can be as coarsely grained as displaying errors within a component as well as as finely grained as displaying step-by-step traces of events.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl logs <pod_name> Print the logs for a pod.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl logs \u2013since=6h <pod_name> Print the logs for the last 6 hours for a pod.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl logs \u2013tail=50 <pod_name> Get the most recent 50 lines of logs.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl logs -f <service_name> [-c <$container>] \u2013 Get logs from a service and optionally select which container.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-7-namespaces-nbsp\"><span id=\"7-namespaces\">#7. Namespaces\u00a0<\/span><\/h4>\n\n\n\n<p>A way to separate groups of resources within a Kubernetes cluster is through namespaces. It is okay for resource names to be different within the same namespace, but not between namespaces. This means you can only use namespace-based scoping on objects that are named (like deployments, services, etc.), not on objects that are used by the whole cluster (like StorageClass, nodes, PersistentVolumes, etc.).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl create namespace <namespace_name>: Create a namespace.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl get namespace <namespace_name> \u2013 List one or more namespaces.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl describes namespace <namespace_name> \u2013 Display the detailed state of one or more namespaces.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-8-nodes\"><span id=\"8-nodes\">#8. Nodes<\/span><\/h4>\n\n\n\n<p>Kubernetes handles your work by putting containers into pods that run on nodes. Depending on the cluster, a node could be a physical or virtual computer. Each node contains the services required to run pods and is controlled by the control plane. Although a cluster usually has several nodes, it might only have one node in a learning or resource-limited setting. One node has the kubelet, a container runtime, and the kube-proxy.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl taint node <node_name>: Update the taints on one or more nodes.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl get node: List one or more nodes.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl delete node <node_name>: Delete a node or multiple nodes.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl top node <node_name> \u2013 Display Resource usage (CPU, memory, and storage) for nodes.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-9-services\"><span id=\"9-services\">#9. Services<\/span><\/h4>\n\n\n\n<p>A simple way to make a network service out of an app running on a group of pods Because Kubernetes uses a familiar service discovery mechanism, you don\u2019t have to change your app to use it. That is to say, Kubernetes pods have their own IP addresses and a single DNS name that is used for all of them. It can also spread the load across all of them.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl get services: list one or more services.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl describes services by displaying the detailed state of a service.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl expose deployment [deployment_name]: expose a replication controller, service, deployment, or pod as a new Kubernetes service.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl edit services edit\u00a0 and update the definition of one or more services<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-10-pods\"><span id=\"10-pods\">#10. Pods<\/span><\/h4>\n\n\n\n<p>In Kubernetes, pods are the tiniest units of computing that can be deployed. If you think of a pod as a group of whales or peas, then a pod is a group of one or more containers that share storage and network resources and are told how to run.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl gets pods. List one or more pods.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl get pods \u2013sort-by=\u2019.status.containerStatuses[0].restart count: List pods sorted by restart count.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl get pods \u2013field-selector=status.phase=Running: Get all running pods in the namespace.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-11-replicasets\"><span id=\"11-replicasets\">#11. ReplicaSets<\/span><\/h4>\n\n\n\n<p>The job of a ReplicaSet is to keep a stable group of replica pods running at all times. Because of this, it is often used to promise the availability of a certain number of pods that are exactly the same.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl gets replicasets \u2013 listing ReplicaSets.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl describes replicasets <replicaset_name> displays the detailed state of one or more ReplicaSets.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl scale \u2013replicas=[x] Scale a ReplicaSet<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-to-run-kubectl-commands-in-windows\"><span id=\"how-to-run-kubectl-commands-in-windows\">How to Run Kubectl Commands in Windows<\/span><\/h2>\n\n\n\n<p>Users must use a version of Kubectl that is only slightly different from the version used by their cluster. A v1.22 client, for example, can communicate with control panels from v1.23, v1.22, and v1.21. Therefore, it is preferable to keep Kubectl at its most recent version to avoid unexpected problems with the system. This tutorial will cover the installation and running of Kubectl on Windows systems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-to-run-kubectl-commands-in-windows-step-by-step-guide\"><span id=\"how-to-run-kubectl-commands-in-windows-step-by-step-guide\">How to Run Kubectl Commands in Windows: Step-by-Step Guide<\/span><\/h3>\n\n\n\n<p>Because Kubernetes is designed to work with Linux, the only way to use it on Windows is on a virtual machine. So, create a virtual environment for running Kubernetes by following the instructions below.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-1-nbsp\"><span id=\"step-1\">Step 1.\u00a0<\/span><\/h4>\n\n\n\n<p>Download the latest v1.22.0 release by using the following URL:<\/p>\n\n\n\n<p><a href=\"https:\/\/dl.k8s.io\/release\/v1.22.0\/bin\/windows\/amd64\/kubectl.exe\">https:\/\/dl.k8s.io\/release\/v1.22.0\/bin\/windows\/amd64\/kubectl.exe<\/a><\/p>\n\n\n\n<p>Note: In order to find out the latest stable Kubectl version, visit https:\/\/dl.k8s.io\/release\/stable.txt.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-2-nbsp\"><span id=\"step-2\">Step 2.\u00a0<\/span><\/h4>\n\n\n\n<p>(Optional) In order to validate the Kubectl binary, download the Kubectl checksum file by executing the following curl command:<\/p>\n\n\n\n<p>curl -LO https:\/\/dl.k8s.io\/v1.22.0\/bin\/windows\/amd64\/kubectl.exe.sha256<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-3-nbsp\"><span id=\"step-3\">Step 3.\u00a0<\/span><\/h4>\n\n\n\n<p>To validate the Kubectl binary against the checksum file, use either one of the methods:<\/p>\n\n\n\n<p>a) Manually compare CertUtil\u2018s output to the checksum file downloaded using the Command Prompt:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CertUtil -hashfile kubectl.exe SHA256<\/li>\n\n\n\n<li>type kubectl.exe.sha256<\/li>\n<\/ul>\n\n\n\n<p>b) Automate the verification using the -eq operator to get a true or false result using the PowerShell:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u00a0\u00a0$(CertUtil -hashfile .\\kubectl.exe SHA256)[1] -replace \u201d \u201c, \u201c\u201d) -eq $(type .\\kubectl.exe.sha256)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-4-nbsp\"><span id=\"step-4\">Step 4.\u00a0<\/span><\/h4>\n\n\n\n<p>Next, add the kubectl binary to the user\u2019s PATH.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-step-5-nbsp\"><span id=\"step-5\">Step 5.\u00a0<\/span><\/h4>\n\n\n\n<p>Finally, execute the following command to make sure that the available Kubectl version is the same as the downloaded version:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Kubectl version \u2013client<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-the-use-of-kubectl\"><span id=\"what-is-the-use-of-kubectl\">What is the use of kubectl?<\/span><\/h2>\n\n\n\n<p>kubectl, allows you to run commands against Kubernetes clusters.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-how-do-i-use-kubernetes-commands\"><span id=\"how-do-i-use-kubernetes-commands\">How do I use Kubernetes commands?<\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>kubectl [command] [TYPE] [NAME] [flags] where command, TYPE, NAME, and flags are<\/li>\n<\/ul>\n\n\n\n<p>kubectl config set-context \u2013current \u2013namespace=<namespace-name> Operations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-which-common-command-is-used-in-kubernetes\"><span id=\"which-common-command-is-used-in-kubernetes\">Which common command is used in Kubernetes?<\/span><\/h2>\n\n\n\n<p>It is kubectl\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-kubernetes-vs-docker\"><span id=\"what-is-kubernetes-vs-docker\">What is Kubernetes vs Docker?<\/span><\/h2>\n\n\n\n<p>While Docker is a container runtime, Kubernetes is a platform for running and managing containers from many container runtimes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion-nbsp\"><span id=\"conclusion\">Conclusion\u00a0<\/span><\/h2>\n\n\n\n<p>This tutorial presents the steps to install, set up, and run the Kubectl command-line tool on Windows systems. I hope this tutorial was helpful, and do reach out to us if you have any queries or suggestions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-references\"><span id=\"references\">References<\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.interviewbit.com\/kubernetes\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">.interviewbit.<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/spacelift.io\/b\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">spacelift.<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.bluematador.com\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">.bluematador<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/komodor.com\/l\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">komodor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/serverhealers.com\/b\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">serverhealers.<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-related-articles\"><span id=\"related-articles\">Related Articles<\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/businessyield.com\/tech\/technology\/20-basic-linux-commands-with-examples-a-beginners-guide\/\">20 Basic Linux Commands With Examples: A Beginner\u2019s Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/businessyield.com\/tech\/how-to\/how-to-install-powershell-for-mac\/\">How to Install PowerShell for Mac: Easy Step-By-Step<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/businessyield.com\/tech\/how-to\/how-to-install-node-js\/\">HOW TO INSTALL NODE. js: The Complete Guide<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/businessyield.com\/tech\/cyber-security\/aws-firewall\/\">AWS FIREWALL: How Does It Work?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/businessyield.com\/tech\/cyber-security\/malvertising\/\">Malvertising: What Is It & How Do You Prevent It?<\/a><\/li>\n<\/ol>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"If you are new to Kubernetes, it can be hard to keep track of everything. Knowing about all&hellip;\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":286,"featured_media":16530,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[301],"tags":[],"class_list":{"0":"post-16216","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-terms"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>KUBECTL COMMANDS: Everything You Need To Know<\/title>\n<meta name=\"description\" content=\"Kubectl commands is a line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This Kebectle commands cheat sheet helps you run commands on a lot of common Kubernetes resources, Windows, and components.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KUBECTL COMMANDS: Everything You Need To Know\" \/>\n<meta property=\"og:description\" content=\"Kubectl commands is a line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This Kebectle commands cheat sheet helps you run commands on a lot of common Kubernetes resources, Windows, and components.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Business Yield Technology\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-30T02:32:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-30T02:33:01+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"250\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Chinecherem Onuorah\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Chinecherem Onuorah\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/\"},\"author\":{\"name\":\"Chinecherem Onuorah\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/#\\\/schema\\\/person\\\/59cd27f29aeeb00675e27d3db92755f1\"},\"headline\":\"KUBECTL COMMANDS: Everything You Need To Know\",\"datePublished\":\"2023-11-30T02:32:59+00:00\",\"dateModified\":\"2023-11-30T02:33:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/\"},\"wordCount\":2190,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/businessyield.com\\\/tech\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/11\\\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1\",\"articleSection\":[\"Terms\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/\",\"url\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/\",\"name\":\"KUBECTL COMMANDS: Everything You Need To Know\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/businessyield.com\\\/tech\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/11\\\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1\",\"datePublished\":\"2023-11-30T02:32:59+00:00\",\"dateModified\":\"2023-11-30T02:33:01+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/#\\\/schema\\\/person\\\/59cd27f29aeeb00675e27d3db92755f1\"},\"description\":\"Kubectl commands is a line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This Kebectle commands cheat sheet helps you run commands on a lot of common Kubernetes resources, Windows, and components.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/businessyield.com\\\/tech\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/11\\\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/businessyield.com\\\/tech\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2023\\\/11\\\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1\",\"width\":500,\"height\":250,\"caption\":\"Image by Freepik\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/terms\\\/kubectl-commands\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KUBECTL COMMANDS: Everything You Need To Know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/#website\",\"url\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/\",\"name\":\"Business Yield Technology\",\"description\":\"Best Tech Reviews, Apps, Phones, &amp; Gaming\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/#\\\/schema\\\/person\\\/59cd27f29aeeb00675e27d3db92755f1\",\"name\":\"Chinecherem Onuorah\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b09cd1b748a80d7e00bb7711687b0a4daa460ffcee63ac720f8fabd37eac2d7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b09cd1b748a80d7e00bb7711687b0a4daa460ffcee63ac720f8fabd37eac2d7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/1b09cd1b748a80d7e00bb7711687b0a4daa460ffcee63ac720f8fabd37eac2d7?s=96&d=mm&r=g\",\"caption\":\"Chinecherem Onuorah\"},\"description\":\"Onuora Favour is a content writer, editor, and lifelong learner with an insatiable desire to discover new things. She combines her bachelor's degree in business administration with her natural interest and expertise as a sales team lead and SEO expert to offer comprehensive articles that are informative for individuals and business owners.\",\"url\":\"https:\\\/\\\/businessyield.com\\\/tech\\\/author\\\/chinecherem\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KUBECTL COMMANDS: Everything You Need To Know","description":"Kubectl commands is a line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This Kebectle commands cheat sheet helps you run commands on a lot of common Kubernetes resources, Windows, and components.","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:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/","og_locale":"en_US","og_type":"article","og_title":"KUBECTL COMMANDS: Everything You Need To Know","og_description":"Kubectl commands is a line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This Kebectle commands cheat sheet helps you run commands on a lot of common Kubernetes resources, Windows, and components.","og_url":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/","og_site_name":"Business Yield Technology","article_published_time":"2023-11-30T02:32:59+00:00","article_modified_time":"2023-11-30T02:33:01+00:00","og_image":[{"width":500,"height":250,"url":"http:\/\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg","type":"image\/jpeg"}],"author":"Chinecherem Onuorah","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Chinecherem Onuorah","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#article","isPartOf":{"@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/"},"author":{"name":"Chinecherem Onuorah","@id":"https:\/\/businessyield.com\/tech\/#\/schema\/person\/59cd27f29aeeb00675e27d3db92755f1"},"headline":"KUBECTL COMMANDS: Everything You Need To Know","datePublished":"2023-11-30T02:32:59+00:00","dateModified":"2023-11-30T02:33:01+00:00","mainEntityOfPage":{"@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/"},"wordCount":2190,"commentCount":0,"image":{"@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1","articleSection":["Terms"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/","url":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/","name":"KUBECTL COMMANDS: Everything You Need To Know","isPartOf":{"@id":"https:\/\/businessyield.com\/tech\/#website"},"primaryImageOfPage":{"@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#primaryimage"},"image":{"@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1","datePublished":"2023-11-30T02:32:59+00:00","dateModified":"2023-11-30T02:33:01+00:00","author":{"@id":"https:\/\/businessyield.com\/tech\/#\/schema\/person\/59cd27f29aeeb00675e27d3db92755f1"},"description":"Kubectl commands is a line tool for Kubernetes configuration that talks to a Kubernetes API server. You can create, inspect, update, and delete Kubernetes objects with Kubectl. This Kebectle commands cheat sheet helps you run commands on a lot of common Kubernetes resources, Windows, and components.","breadcrumb":{"@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#primaryimage","url":"https:\/\/i0.wp.com\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1","contentUrl":"https:\/\/i0.wp.com\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1","width":500,"height":250,"caption":"Image by Freepik"},{"@type":"BreadcrumbList","@id":"https:\/\/businessyield.com\/tech\/terms\/kubectl-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/businessyield.com\/tech\/"},{"@type":"ListItem","position":2,"name":"KUBECTL COMMANDS: Everything You Need To Know"}]},{"@type":"WebSite","@id":"https:\/\/businessyield.com\/tech\/#website","url":"https:\/\/businessyield.com\/tech\/","name":"Business Yield Technology","description":"Best Tech Reviews, Apps, Phones, &amp; Gaming","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/businessyield.com\/tech\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/businessyield.com\/tech\/#\/schema\/person\/59cd27f29aeeb00675e27d3db92755f1","name":"Chinecherem Onuorah","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1b09cd1b748a80d7e00bb7711687b0a4daa460ffcee63ac720f8fabd37eac2d7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1b09cd1b748a80d7e00bb7711687b0a4daa460ffcee63ac720f8fabd37eac2d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1b09cd1b748a80d7e00bb7711687b0a4daa460ffcee63ac720f8fabd37eac2d7?s=96&d=mm&r=g","caption":"Chinecherem Onuorah"},"description":"Onuora Favour is a content writer, editor, and lifelong learner with an insatiable desire to discover new things. She combines her bachelor's degree in business administration with her natural interest and expertise as a sales team lead and SEO expert to offer comprehensive articles that are informative for individuals and business owners.","url":"https:\/\/businessyield.com\/tech\/author\/chinecherem\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/businessyield.com\/tech\/wp-content\/uploads\/sites\/2\/2023\/11\/cccccccccccc-60.jpg?fit=500%2C250&ssl=1","jetpack_sharing_enabled":true,"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/posts\/16216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/users\/286"}],"replies":[{"embeddable":true,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/comments?post=16216"}],"version-history":[{"count":3,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/posts\/16216\/revisions"}],"predecessor-version":[{"id":16541,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/posts\/16216\/revisions\/16541"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/media\/16530"}],"wp:attachment":[{"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/media?parent=16216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/categories?post=16216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/businessyield.com\/tech\/wp-json\/wp\/v2\/tags?post=16216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}