kubectl

nodes

Nodes are the systems that run the kubernetes stuff.

get nodes

List the nodes and some basic information about them:

$ kubectl get nodes

NAME     STATUS   ROLES                  AGE   VERSION
node0    Ready    control-plane,master   90m   v1.23.3
node1    Ready    <none>                 83m   v1.23.3
node2    Ready    <none>                 69m   v1.23.3
salusa   Ready    <none>                 78s   v1.23.3

describe nodes

Get more detailed information about a node.

$ kubectl describe node NODE_NAME

namespaces

Used for separating the different applications. wat?

get namespaces

$ kubectl get namespaces
NAME                   STATUS   AGE
default                Active   100m
kube-node-lease        Active   100m
kube-public            Active   100m
kube-system            Active   100m
kubernetes-dashboard   Active   93m

use namespace

The kubectl -n NAMESPACE flag can be used to specify a namespace.

$ kubectl -n kubernetes-dashboard get pods

pods

Applications get run in pods.

get pods

Get a list of the pods in a namespace. The default namespace is used if not specified.

$ kubectl -n kubernetes-dashboard get pods
NAME                                         READY   STATUS    RESTARTS   AGE
dashboard-metrics-scraper-799d786dbf-7hqnk   1/1     Running   0          95m
kubernetes-dashboard-6b6b86c4c5-dph98        1/1     Running   0          95m

describe pod

Get more information about a pod.

$ kubectl -n kubernetes-dashboard describe POD_NAME