Configuring K3S using k3sup in AWS

Priyanshu Bhatt
Towards Dev
Published in
3 min readApr 14, 2022

--

Kubernetes Installation can be a pain for Engineers as there are lots of Kubernetes distribution and Tools to configure them flowing in the market and sometimes choosing the best one for your use case becomes a hectic job for many practitioners. Each offers different utilities and overhead configuration challenges to get up and running on your Kubernetes cluster. Here we will discuss a very powerful lightweight Kubernetes distribution called K3s and How you can configure in no time.

K3s is designed to be a single binary of less than 40 MB that completely implements the Kubernetes API. It’s like software with removed excess drivers replaced with add-ons.

Features of K3s:

  1. It can be run over a starting RAM of 512MB .
  2. K3s is a highly available, certified Kubernetes distribution perfect for edge devices.
  3. Can work greatly with even a Raspberry Pi.
  4. SQLite as storage backend instead of etcd and Containerd as default container runtime (not Docker).

Installing k3s can be done simply using utilities like k3sup,k3d, etc. Here in this blog, we will install k3s using k3sup(ketchup) which is a lightweight utility to get from zero to Kubeconfig with k3s on local or remote quickly and easily using ssh access.

Prerequisite

This tutorial will be a hands-on demonstration, So to follow along make sure you have the following:

  1. Aws account - Don’t worry if you don’t have one you can Quickly create one following this guide -https://aws.amazon.com/premiumsupport/knowledge-center/create-one and-activate-aws-account/

Configuring k3s in AWS

Here we are using AWS Linux as our VM for the demo you can do the same in any other Linux AMD and local workstation, we will be doing this as a purpose for a local computer so we can bypass the ssh using a local tag.

Step 1: Launch an ec2 instance with bare minimum requirements.

To launch an ec2 instance is the first step to set up our work area, Here we are I used Amazon Linux to set up our local cluster.

link: https://aws.amazon.com/premiumsupport/knowledge-center/launch-instance-custom-ami/ (refer to this link for how to launch an ec2 instance)

Step 2: Download the k3sup using the GitHub repo of Alex Ellis(https://github.com/alexellis/k3sup).

curl -sLS https://get.k3sup.dev | sh

sudo install k3sup /usr/local/bin/

k3sup --help

Step3: As an alternative in this article we are launching a single server in our work Area, you can log in interactively and run k3sup install --local instead of using SSH.

now to test that the cluster is up and working fine use these commands:

export KUBECONFIG=/usr/local/bin/kubeconfig

kubectl config set-context defualt

kubectl get node -o wide

If you did everything correctly then you cluster will show all the available nodes.

Lets launch a pod and see if everything is working fine or not.

kubectl run test -image=httpd

Conclusion

I hope now you will be able to configure your lightweight Kubernetes Distribution using k3sup and start your Kubernetes journey quickly with the power of k3s.

Thanks for Reading.

--

--

AWS Solutions Architect || Terraform Certified Associate || DevOps Engineer || I Share Crisp Tech Stories linkedin.com/in/priyanshubhatt