You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Information Commands

CommandDescription

kubectl cluster-info

Display Cluster Info
kubectl config viewDisplay Config


kubectl get pods

List all running pods
kubectl get servicesList all services
kubectl get nodesList all nodes

kubectl get deployments

Deployments view
kubectl get rcList replication controllers

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


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

kubectl expose deployment cloudservice --type=LoadBalancer --name=cloud

Expose pod


Minikube Commands

CommandDescription
minikube startStart
minikube stopStop
minikube dashboardDisplay dashboard
minikube sshlog into minikube

ssh -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip)

log into minikube
cat ~/.minikube/machines/minikube/config.jsonView 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.
minikube ipget ip of minikube
minikube service <service>Open browser to exposed service


Reference

  • No labels