This document lists and describes some of the most frequently used kubectl commands for managing Kubernetes objects and clusters. It provides the command syntax, purpose, and a brief description for commands like kubectl api-versions, kubectl apply, kubectl attach, kubectl cluster-info, kubectl config, kubectl create, kubectl delete, kubectl describe, kubectl exec, kubectl expose, kubectl logs, kubectl port-forward, kubectl replace, kubectl rollout, kubectl set, and kubectl top.
This document lists and describes some of the most frequently used kubectl commands for managing Kubernetes objects and clusters. It provides the command syntax, purpose, and a brief description for commands like kubectl api-versions, kubectl apply, kubectl attach, kubectl cluster-info, kubectl config, kubectl create, kubectl delete, kubectl describe, kubectl exec, kubectl expose, kubectl logs, kubectl port-forward, kubectl replace, kubectl rollout, kubectl set, and kubectl top.
In my previous article, we already have learnedwhat is Kubernetes, its architecture and what
is the difference betweenDocker and Kubernetes.
In this article, we will looking into some of the frequently used Kubeclt commands that are used to manage and interact Kubernetes objects and clusters along with its purpose.
Below is the list of most frequently used Kubeclt commands.
Kubeclt Command Purpose
kubectl api-versions This command will print the supported versions of API on the cluster. kubectl apply –f This command will configure <filename> a resource by file or stdin kubectl attach <pod> –c This command will attach <container> things to the running container. kubectl cluster-info This command will display the cluster Information. kubectl cluster-info dump This command will dump relevant information regarding cluster for debugging and diagnosis. kubectl config This command willModifies <SUBCOMMAD> the kubeconfig file. kubectl config current- This will display displays the context current context. kubectl config delete- This will delete the specified cluster <Cluster Name> cluster from kubeconfig kubectl config delete- This command will delete a context <Context Name> specified context from kubeconfig. kubectl config get-cluster This command will display cluster defined in the kubeconfig. kubectl config get- This command will Describe context <Context Name> one or many contexts. kubectl config set- This command will Set the credentials cluster-admin user entry in kubeconfig --username = ankur -- password = SesrweU9l75qciy kubectl config set This command will set an PROPERTY_NAME individual value in kubeconfig PROPERTY_VALUE file.
kubectl config use- This command will set the
context <Context Name> current context in kubectl file.
kubectl cp <Files from This command will copy files
source> <Files to and directories to and from Destinatiion> containers.
kubectl create –f <File This command will create the
Name> resources by filename. kubectl replace -f This command will replace a FILENAME resource by file name or stdin. Kubectl rollout <Sub This command is capable of Command> managing the rollout of deployment. kubectl set image (-f This command will update FILENAME | TYPE NAME) the image of a pod template.
(Ebook) AWS System Administration, 2nd Edition (Second Early Release) by Mike Ryan and Federico Lucifredi ISBN 9781492081562, 1492081566 - The full ebook version is ready for instant download