Kubernetes
    Kubernetes - Overview
    Kubernetes - Objects
    Kubernetes - API Extensions
    Kubernetes - apimachinery
    Kubernetes - Container Runtimes (CRI)
    Kubernetes - Storage (CSI)
    Kubernetes - Networking (CNI)
    Kubernetes - Ecosystem
    Kubernetes - Tools
    Kubernetes - kubectl
    Kubernetes - client-go
    Kubernetes - Source Code
    Kubernetes - Kind
    Kubernetes - kubeconfig
    Kubernetes - Versus

kubectl

Updated: 2022-09-10

Clusters

Get a list of clusters:

$ kubectl config get-clusters
NAME
kind-kind

Get Cluster Info

$ kubectl cluster-info
$ kubectl cluster-info dump

Specify output columns

$ kubectl get services -A -o=custom-columns=NAME:.metadata.name,Namespace:.metadata.namespace

API Resources

To see which Kubernetes resources are and aren't in a namespace:

# In a namespace
$ kubectl api-resources --namespaced=true

# Not in a namespace
$ kubectl api-resources --namespaced=false

Get a list of Services:

$ kubectl get services

Get a list of controllers: check the service accounts:

$ kubectl -n kube-system get sa

Check resource consumption

$ kubectl top node
$ kubectl top pod -A

Pods

Get pods on a specific node.

$ kubectl get pods --all-namespaces -o wide --field-selector spec.nodeName=<node>

Plugins

Add the tree plugin to visualize

$ kubectl krew install tree