Kubernetes Reference

Kubernetes command reference:

  • kubectl get nodes : Show all nodes connected to the master.
  • kubectl describe node xyz : Show detailed information about a node.

Notes:

Here is some reference information for a Kubernetes project I am working on.
I will likely continue to add information here for a while as I dig into it.

An approachable package is K3s, you can launch the installation for the master node via:

curl -sfL https://get.k3s.io | sh -

Additional nodes can be added by referencing the IP/DNS name of the master, and a token found at /var/lib/rancher/k3s/server/node-token

curl -sfL https://get.k3s.io | K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh -

To install helm / tiller you can use this process, first ensure the KUBECONFIG variable is exported, export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
Then, you can pull the installer and kickoff the helm installation:

curl -sFl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | sh -

helm init
helm repo update

kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller

DavisSystem

Consolidated Notes From the Desk of Sean Davis.


Kubernetes Reference

By Sean, 2024-05-20