K3S
Creating Kubernetes Cluster with k3s¶
K3s is a lightweight Kubernetes distribution that Rancher Labs, which is fully certified Kubernetes offering by CNCF. In K3s, we see that the memory footprint or binary which contains the components to run a cluster is small. It means that K3s is small in size.
Requirements¶
- docker to be able to use k3d at all
- kubectl to interact with the Kubernetes cluster
Setup¶
curl -sfL https://get.k3s.io | sh -
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
sudo chmod 644 $KUBECONFIG
kind: Simple
apiVersion: k3d.io/v1alpha2
name: my-cluster
image: rancher/k3s:v1.20.4-k3s1
servers: 1
agents: 2
ports:
- port: 80:80
nodeFilters:
- loadbalancer
Multi-Node Cluster Setup