Skip to content

ashwat287/k3sClusterOnLima

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

K3s Cluster on Lima

This repo provides shell scripts to spin up and clean up a local 2-node K3s cluster on Lima.

What Gets Created

./create-k3s-cluster.sh creates:

  • k3s-master (control plane): 1 CPU, 2GiB RAM, 30GiB disk
  • k3s-worker (agent): 2 CPU, 4GiB RAM, 40GiB disk

Both VMs use the template:k3s Lima template and lima:user-v2 network.

Prerequisites

  • lima / limactl
  • kubectl

Verify:

limactl --version
kubectl version --client

Create Cluster

./create-k3s-cluster.sh

The script:

  1. Starts k3s-master
  2. Reads the cluster join token from master
  3. Starts k3s-worker and joins it to master
  4. Exports KUBECONFIG for the master kubeconfig path (for the current shell process)
  5. Runs kubectl get nodes

If you want KUBECONFIG in your current interactive shell, run:

export KUBECONFIG="$(limactl list k3s-master --format '{{.Dir}}/copied-from-guest/kubeconfig.yaml')"
kubectl get nodes -o wide

Cleanup Lima VMs

Remove all Lima VMs (with confirmation):

./cleanup-lima-vms.sh

Remove all Lima VMs without confirmation:

./cleanup-lima-vms.sh -f

Show cleanup help:

./cleanup-lima-vms.sh -h

About

Dual node K3s cluster (master + 1 worker ) built on lima-vm for MacBook Air 2019 remote server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages