kubernetes : kubectl useful commands

Working through the interactive tutorial here is a good reference for kubectl usage.

A few notes for reference:

Copy master node config to a remote machine (from here):

scp root@<master ip>:/etc/kubernetes/admin.conf .

All of the commands if running on a remote machine can use the copied conf file by passing: --kubeconfig ./admin.conf

Query nodes in the cluster:

kubectl get nodes

Show current cluster info:

./kubectl cluster-info

Kubernetes master is running at

KubeDNS is running at

From the interactive tutorial:

Run kubernetes-bootcamp:

kubectl run kubernetes-bootcamp --image=docker.io/jocatalin/kubernetes-bootcamp:v1 --port=8080


kubectl get pods
kubectl describe pod podname
kubectl delete pod podname


kubectl get deployments
kubectl describe deployment deploymentname
kubectl delete deployment deploymentname

Get logs

kubectl logs podname

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.