List of some basic and usefull commands of kubectl
--Get the nodes (servers)
kubectl get nodes
-- Get the pods (deployments)
kubectl get pod
-- Get Services (controllers)
kubectl get services
-- Creating a deployment from an image
kubectl create deployment nginx-depl --image=nginx
-- Get the depolyments
kubectl get deployment
-- Getting the replicas
kubectl get replicaset
-- Editing deployments
kubectl edit deployment nginx-depl
-- Getting the logs of a pod
kubectl logs nginx-depl-xxxx
-- Executing a terminal of interation
kubectl exec -it nginx-depl-xxx -- bin/bash
-- Deleting a deployment
kubectl delete deployment nginx-depl
-- Creating a deployment from a file YAML
kubectl apply -f https://raw.githubusercontent.com/rondweb/kubernetes/main/nginx-deployment.yaml
-- Describing a pod
kubectl describe pod nginx-depl_xxx
-- Getting the info of a namespace
kubectl get namespace
-- Setting the context
kubectl config set-context –current –namespace=kong