Advance | Top 10 Kubernetes commands
Published in
2 min readFeb 6, 2023
Let’s keep the Kubernetes journey rolling! Check out this continuation of the blog for those must-know fundamental commands. And don’t forget to bring your sense of humor along for the ride! :) 🚀
Here are 10 advanced Kubernetes commands:
kubectl cp
— Copy files and directories to and from containers.
Example: kubectl cp <pod-name>:<container-path> <host-path>kubectl auth
— Manage authentication and authorization in a cluster.
Example: kubectl auth reconcilekubectl config
— Modify the configuration of the Kubernetes CLI.
Example: kubectl config use-context <context-name>kubectl taint
— Taint a node, causing pods to be rescheduled to other nodes.
Example: kubectl taint nodes <node-name> key=value:NoSchedulekubectl label
— Add, modify, or remove labels on a resource.
Example: kubectl label pods <pod-name> app=nginxkubectl top
— Display resource usage for nodes or pods.
Example: kubectl top nodekubectl patch
— Apply a patch to a resource.
Example: kubectl patch deployment <deployment-name> -p ‘{“spec”: {“replicas”: 3}}’kubectl run
— Create a new deployment using a single command.
Example: kubectl run nginx — image=nginx — restart=Never — generator=run/v1kubectl api-resources
— List the available resources in the cluster.
Example: kubectl api-resources — namespaced=falsekubectl explain
— Get detailed information about a specific resource field.
Example: kubectl explain pod.spec.containers
Thanks for reading! I appreciate your support 👏 and engagement 🚙 in my stories. I’m always looking for ways to improve, so please feel free to leave a comment or share your thoughts.
Don’t miss a beat! Subscribe to my newsletter to get my latest articles and content delivered directly to your inbox.