in our previous article we have discussed what is Kubernetes
in this article we will go through the most important commands you need to know when you are dealing with K8
Check version
Check the version of kubectl and the Kubernetes cluster.
kubectl version
get pods
List all pods in the current namespace.
kubectl get pods
get nodes
List all nodes in the cluster
kubectl get nodes
get deployments
List all deployments in the current namespace.
kubectl get deployments
describe pod
Get detailed information about a specific pod.
kubectl describe pod [pod_name]
get logs
View the logs of a specific pod.
kubectl logs [pod_name]
apply
Apply a configuration file to create or update a resource (e.g., pod, service, deployment).
kubectl apply -f [filename]
Execute
Execute a command in a running pod.
kubectl exec -it [pod_name] -- [command]
scale deployment
Scale the number of replicas for a deployment.
kubectl scale deployment [deployment_name] --replicas=[num_replicas]
Delete resource
Delete a resource by specifying its type and name.
kubectl delete [resource_type] [resource_name]
these are commands you need to get started but for sure you will need more commands
Top comments (2)
thanks for this list
you welcome