Kubernetes Cheat Sheet


Choosing the correct context

First check out your available contexts like this:

kubectl config get-contexts
CURRENT   NAME                                                 CLUSTER                                              AUTHINFO                                             NAMESPACE
*        do-toms-cluster                                      do-toms-cluster                                      do-toms-cluster-admin
          gke_symmetric-blade-21345                            gke_symmetric-blade-21345                            gke_symmetric-blade-21345

You can then choose the desired context like this:

kubectl config use-context do-toms-cluster

Merging Multiple Contexts


How to run kubeconfig

At first it’s best to run kubeconfig from the k3s server itself. Here’s a nice alias for it:

alias kubectl='sudo k3s kubectl'


Installation of a Chart

First grab the values like thes:

helm get values RELEASE_NAME [flags]

Update the values.yaml file and then install the chart like this:

helm install -f myvalues.yaml RELEASE_NAME [--namespace NAMESPACE] CHARTNAME

Debugging / Development