K3s

K3s is a lightweight, easy-to-install Kubernetes distribution designed for simplicity and minimal resource usage, ideal for edge, IoT, and development environments. It’s great for getting started because it reduces complexity while providing the full Kubernetes experience, making it perfect for learning and small-scale deployments.

Install K3S

Source of installl script https://docs.k3s.io/quick-start

Install Script

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

Change permissions

sudo chmod 644 /etc/rancher/k3s/k3s.yaml

Configure KUBECONFIG for the non root user

This is needed as once k3s restarts, permissions are lost. One must create persistent permissions.

mkdir -p ~/.kube 

sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config 

echo 'export KUBECONFIG=~/.kube/config' >> ~/.bashrc 

source ~/.bashrc

sudo chown $(id -u):$(id -g) ~/.kube/config

Create alias for kubectl to save typing echo 'alias k=kubectl' >> ~/.bashrc

Connect 'k' alias to 'kubectl' auto complete complete -o default -F __start_kubectl k

Send Kubectl Tab Completion to .bashrc echo "source <(kubectl completion bash)" >> ~/.bashrc

Restart config source ~/.bashrc


When shit hits the fan Attach to the container kubectl exec -it dev-pod -c dev-container -- /bin/bash