[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-572350-105":3,"detail-sidebar-cat-1-en-105":81,"doc-detail-572350-en":127},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","kubernetes-cheat-sheet-kubectl-commands-summary","Kubernetes Cheat Sheet - kubectl Commands Summary","","Kubernetes Cheat Sheet provides a concise operational reference for managing containerized applications on Kubernetes clusters. It explains how Kubernetes supports deploying and scaling workloads, coordinating changes, and optimizing underlying hardware usage. The cheat sheet summarizes common kubectl workflows, including creating resources from YAML/JSON or names, running interactive pods, attaching and executing commands in containers, scaling deployments, retrieving and describing resource states, viewing pod logs, exposing services externally, and deleting pods and services.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/template/","Template",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/template/presentations/","Presentations",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/template/kubernetes-cheat-sheet-kubectl-commands-summary/572350/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/kubernetes-cheat-sheet-kubectl-commands-summary/572350.png","ImageObject",442,249,{"name":42,"@type":43},"\tJames","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-10-22","2026-10-13",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",8,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"How do you create Kubernetes resources using kubectl?","Question",{"text":63,"@type":64},"Use kubectl create with a YAML/JSON file or a resource name, for example creating deployments, jobs, cronjobs, and nodes with the required image and parameters.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"What is the difference between kubectl run and interacting with a container?",{"text":68,"@type":64},"kubectl run starts a new pod, while attach/exec connect to an already running container to open a shell or run single commands.",{"name":70,"@type":61,"acceptedAnswer":71},"How can you scale and autoscale a deployment?",{"text":72,"@type":64},"Scale by setting replicas for a deployment, and autoscale by providing min/max values and CPU percentage thresholds for the deployment.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},572350,1792033356,{"code":4,"msg":82,"data":83},"success",[84,88,93,98,103,108,113,118,123],{"id":85,"doc_module":22,"doc_module_name":25,"category_name":29,"show_sort_weight":86,"slug":87},11,90,"presentations",{"id":89,"doc_module":22,"doc_module_name":25,"category_name":90,"show_sort_weight":91,"slug":92},12,"Resumes",80,"resumes",{"id":94,"doc_module":22,"doc_module_name":25,"category_name":95,"show_sort_weight":96,"slug":97},14,"Invoices",70,"invoices",{"id":99,"doc_module":22,"doc_module_name":25,"category_name":100,"show_sort_weight":101,"slug":102},15,"Posters",60,"posters",{"id":104,"doc_module":22,"doc_module_name":25,"category_name":105,"show_sort_weight":106,"slug":107},16,"Social Media",50,"social-media",{"id":109,"doc_module":22,"doc_module_name":25,"category_name":110,"show_sort_weight":111,"slug":112},17,"Forms",40,"forms",{"id":114,"doc_module":22,"doc_module_name":25,"category_name":115,"show_sort_weight":116,"slug":117},18,"Letters",30,"letters",{"id":119,"doc_module":22,"doc_module_name":25,"category_name":120,"show_sort_weight":121,"slug":122},21,"Paper Templates",5,"papers-templates",{"id":124,"doc_module":22,"doc_module_name":25,"category_name":125,"show_sort_weight":4,"slug":126},158,"General","general-158",{"code":4,"msg":82,"data":128},{"doc_id":79,"user_id":129,"nickname":42,"user_avatar":130,"doc_module":22,"category_id":85,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":26,"language":136,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":12,"update_tm":140,"read_time":22},2336474466412,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","Kubernetes Cheat Sheet  \nKubernetes manages clusters of containers, providing tools for deploying and scaling applications, managing changes to containerized applications, and optimizing the use of underlying hardware.  \n\n| kubectl create |  |\n| --- | --- |\n| Create a resource (pod, service, node, job, and so on) referred to by YAML or JSON file, or by name. |  |\n| create deployment foo –-image=\u003Cimage> | Deploy pod foo based on image |\n| create job foo \\\u003Cbr>--image busybox –-echo \"example \" | Create job foo from image busybox to echo \"example\" once |\n| create cronjob foo \\\u003Cbr>--image=busybox \\\u003Cbr>--schedule=\"*/1 * * * *\" \\\u003Cbr>--date | Create cronjob foo from image busybox to print the date every minute |\n| create node –-register-node=false f.json | Create a node from foo.json |\n| expose deployment foo \\\u003Cbr>--type =LoadBalancer --name = foo-service | Create a service to expose foo |\n\n\n| kubectl run |  |\n| --- | --- |\n| run –-stdin –-tty foo \\\u003Cbr>--image =busybox –- /bin/sh | Start a pod called foo with an interactive shell, based on the busybox image |\n| run foo –-image=busybox \\\u003Cbr>--namespace=foo space | Start foo in foospace namespace |\n\n\n| Interacting |  |\n| --- | --- |\n| attach foo -i | Attach to running container foo |\n| exec -–stdin –-tty foo –- /bin/sh | Open a shell in foo |\n| exec foo –-ls | Run a single command in foo |\n| exec foo -c bar –-ls | Run the ls command in bar (in pod foo) |\n\nCC BY-SA 4.0 [Opensource.com](Opensource.com)  \nKubernetes Cheat Sheet  \n\n| Scaling |  |\n| --- | --- |\n| Images serve as blueprints for any number of replicas, which can be created as needed. |  |\n| scale deployment foo -–replicas=3 | Scale deployment foo to 5 |\n| autoscale deployment foo \\\u003Cbr>--max 6 --min 3 --cpu-percent 50 | Autoscale deployment foo |\n\n\n| kubectl get |  |\n| --- | --- |\n| Get information about a resource. |  |\n| get services | List all services in current namespace |\n| get services –-[sort-by=metadata.name](sort-by=metadata.name) | List all services, sorted by name |\n| get pv | List persistent volumes |\n| get pods --all-namespaces | List all pods in all namespaces |\n| get pods \\\u003Cbr>--fieldselector = status.phase =Running | Get all running pods in current namespace |\n| get deployment foo | List deployment foo |\n| describe deployment foo | Get verbose information about foo |\n| logs foo | Dump logs for pod foo to stdout |\n\n\n| kubectl delete |  |\n| --- | --- |\n| delete pod foo | Delete the pod named foo |\n| -–namespace=foospace delete pod,svc --all | Delete all pods and services in namespace foo |\n\nCC BY-SA 4.0 [Opensource.com](Opensource.com)","cbCaisrJFYvuGSo1","https://ap.wps.com/l/cbCaisrJFYvuGSo1","pdf",462910,"English","# kubectl create\n# kubectl run\n# Interacting\n# Scaling\n# kubectl get\n# kubectl delete","[{\"question\":\"How do you create Kubernetes resources using kubectl?\",\"answer\":\"Use kubectl create with a YAML/JSON file or a resource name, for example creating deployments, jobs, cronjobs, and nodes with the required image and parameters.\"},{\"question\":\"What is the difference between kubectl run and interacting with a container?\",\"answer\":\"kubectl run starts a new pod, while attach/exec connect to an already running container to open a shell or run single commands.\"},{\"question\":\"How can you scale and autoscale a deployment?\",\"answer\":\"Scale by setting replicas for a deployment, and autoscale by providing min/max values and CPU percentage thresholds for the deployment.\"}]","Kubernetes Cheat Sheet - kubectl Commands Summary | PDF",1791926887]