Cheat-Sheet forKubernetes
Sep 28, 2022
kubectl apply -f my-manifest.yaml # create resource(s)kubectl delete -f my-manifest.yaml # delete resource(s)kubectl get pods # List all pods in the namespacekubectl edit pods/<pod-name> # Edit Podskubectl describe svc/<service-name> # Describe a Serviceskubectl logs <pod-name> # logs from podkubectl port-forward svc/my-service 5000:my-service-port # Forward Service target port to local port 5000kubectl create deployment my-dep --image=nginx # Create Deploymentkubectl get pods -o wide # List all pods in ps output format with more informationkubectl get pods --all-namespaces # List all pods in all namespaceskubectl get svc # List all services in the namespacekubectl get nodes # Get list Nodes in clusterkubectl get ns # List Namespace# All kubectl Commandshttps://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands# Cheatsheethttps://kubernetes.io/docs/reference/kubectl/cheatsheet/