How to launch a Kubernetes Cluster with k3s on ubuntu

Introduction

Kubernetes has become the go-to platform for container orchestration.In this guide, we’ll show you how to quickly set up a kubernetes cluster using k3s.

k3s is a lightweight and easy-to-use version of kubernetes designed for simplicity and speed.Wheter you’re just starting with kuberentes or need a testing cluster , this step by step tutorial will help you set up running a kuberentes cluster very quickly.

Table of Contents

Prerequisites

Os: Ubuntu

Hardware: 2 cpu , 2 GB ram

K3s is available for the following architectures:

  • x86_64
  • armhf
  • arm64/aarch64
  • s390x

Step 1: Installing k3s

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

Step 2: Verify Installation

After installation , lets see k3s service running status.

systemctl status k3s

We can see k3s service is running.

Step 3: Allow current user to read the kubeconfig file

To allow current user to access kubeconfig file , we need to provide necessary permission to k3s.yaml.

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

Step 4: Verify kubectl get nodes

We can see that , we can see the running nodes.

kubectl get nodes

Step 5: Verify pods running in kube-system

We can see the pods running in kube-system.

kubectl get pods -n kube-system

Congratulations! 🎉 You’ve successfully launched a Kubernetes cluster using k3s. This lightweight and efficient distribution makes setting up Kubernetes quick and hassle-free, whether you’re a beginner experimenting with Kubernetes or a developer needing a small cluster for testing purposes.

With your cluster up and running, you can now start deploying containerized applications, exploring Kubernetes concepts, or integrating additional tools like Helm or monitoring solutions.

If you found this guide helpful, feel free to share it with others starting their Kubernetes journey. Got questions or suggestions? Drop them in the comments below—I’d love to help!

Stay tuned for more Kubernetes and DevOps tutorials on this blog. See you in the next post!

Leave a Reply

Your email address will not be published. Required fields are marked *