Command | Description |
---|---|
kubectl cluster-info | Display Cluster Info |
kubectl config view | Display Config |
kubectl get pods | List all running Pods |
kubectl get pods -o wide | List all pods in ps output format with more information (such as node name). |
kubectl get pods --all-namespaces | List all pods in all namespaces |
| List nodes |
kubectl get rc,services | List all replication controllers and services together in ps output format. |
kubectl logs <pod> | Display the logs for a service |
kubectl logs -f <pod> | Display the logs for a service |
kubectl delete deployment <pod> | Delete a pod (Don't include the instance number) ie. kubectl delete deployment redis |
kubectl exec -it <pod> bash | log into a pod ex. kubectl exec -it cloudservice-bcc6c69ff-bnzcv bash |
Minikube Commands
Command | Description |
---|---|
minikube start | Start |
minikube stop | Stop |
minikube dashboard | Display dashboard |
minikube ssh | log into minikube |
| log into minikube |
cat ~/.minikube/machines/minikube/config.json | View minikube config |
ssh -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip) -R 5000:localhost:5000 | SSH into minikube and setup a port forwarding to your local docker registry. |
Reference
Reference | URL |
---|---|
Cheatsheet | https://kubernetes.io/docs/reference/kubectl/cheatsheet/ |
Kubectl for docker users | https://kubernetes.io/docs/reference/kubectl/docker-cli-to-kubectl/ |