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 the version of kubectl and the Kubernetes cluster.
List all pods in the current namespace.
kubectl get pods
List all nodes in the cluster
kubectl get nodes
List all deployments in the current namespace.
kubectl get deployments
Get detailed information about a specific pod.
kubectl describe pod [pod_name]
View the logs of a specific pod.
kubectl logs [pod_name]
Apply a configuration file to create or update a resource (e.g., pod, service, deployment).
kubectl apply -f [filename]
Execute a command in a running pod.
kubectl exec -it [pod_name] -- [command]
Scale the number of replicas for a deployment.
kubectl scale deployment [deployment_name] --replicas=[num_replicas]
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