Kubernetes kubectl commands¶
Kubernetes provides a command line tool for communicating with a Kubernetes cluster's control plane, using the Kubernetes API.
This tool is named kubectl. kubectl link
Below list most useful Helm Commands for reference.
1. kubectl get¶
Use get to pull a list of resources you have currently on your cluster. The types of resources you can get include:
- Namespace
- Pod
- Node
- Deployment
- Service
- ReplicaSets
2. kubectl describe¶
Describe shows the details of the resource you're looking at.
Resources you can describe include:
- Nodes
- Pods
- Services
- Deployments
- Replica sets
3. kubectl logs¶
logs offer detailed insights into what's happening inside Kubernetes in relation to the pod.
4. kubectl exec¶
exec into a container to troubleshoot an application directly.
5. kubectl cp¶
This command is for copying files and directories to and from containers, much like the Linux cp command. The syntax follows a kubectl cp