Kubernetes

Updated: September 28, 2024

Kubernetes is an open source multifaceted container management system.

Best to learn it chunck by chunk. There are many third party applications involving kubernetes.
These will also be listed under k8s
Kubernetes is performed through the declarative model instead of imperative.


Table of Contents

tldr

# list info about a resource with more details
kubectl get [pod|service|deployment|ingress] -o wide

# update pod with label unhealthy and value true
kubectl lavel pods name unhealthy=true

# list all resources with different types
kubectl get all

# display resource usage of nodes or pods
kubectl top pod|node

# print address of master and cluster services
kubectl cluster-info

# run command in existing pod
kubectl exec pod_name -- ls /

INSTALL

There are several ways to implement a cluster. You may hear of Minikube
however it is not meant for long term use and for learning purposes only.
For a lightweight cluster many use k3s
To setup a full blown cluster use kubeadm

ARGUMENTS

kubeadm bootstraps the cluster.

kubeadm
  init                # create control plane node
  join                # create worker node and join to cluster
  upgrade             # upgrade cluster to newer version
  token               # manage token for join
  reset               # revert init or join changes
  certs               # manage certificates
  kubeconfig          # manage kubeconfig files
  version             # version of kubeadm
  alpha               # preview features in development from feedback community

kubelet runs on all machines for starting pods and containers.

kubectl talks to the cluster.

kubectl
  get
  label
  top
  cluster-info
  explain
  logs
  exec

CONTAINER RUNTIME INTERFACE (CRI) (#cri)

By default will try to detect an installed container runtime by searching known unix domain sockets.

CRI Linux Path
containerd /run/containderd/containerd.sock
CRI-O /var/run/crio/crio.sock
docker /var/run/dockershim.sock