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 imagekubectl create deployment nginx-depl --image=nginx-- Get the depolymentskubectl get deployment-- Getting the replicaskubectl get replicaset-- Editing deploymentskubectl edit deployment nginx-depl-- Getting the logs of a podkubectl logs nginx-depl-xxxx-- Executing a terminal of interationkubectl exec -it nginx-depl-xxx -- bin/bash-- Deleting a deploymentkubectl delete deployment nginx-depl-- Creating a deployment from a file YAMLkubectl 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 namespacekubectl get namespace-- Setting the contextkubectl config set-context –current –namespace=kong
Post a Comment