MicroK8s is a lightweight, zero-ops Kubernetes distribution for workstations, clusters, edges, and IoT devices that has received CNCF certification. All Kubernetes services are executed natively (i.e., without the use of virtual machines) and are packaged as a snap, which includes all necessary libraries, binaries, and the most widely used Kubernetes add-ons. The speed at which you may download a few hundred megabytes limits installation, and MicroK8s can be deleted without leaving any trace. An open-source solution called MicroK8s automates the administration, scaling, and deployment of containerized applications. You can use it to quickly set up a small single-node cluster in your local setting. It offers the fundamental Kubernetes component capabilities in a compact form factor that scales from a single node to a high-availability production cluster. But MicroK8s wants to make it easier to construct K8s and cloud-native applications. We mentioned below are the steps to install Kubernetes development cluster with microk8s.

Steps to install Kubernetes development cluster with microk8s

Set up hostnames

Step 1: Before we install microk8s, let’s set our hostnames. We’ll set the controller to microk8s1 and the node to microk8s2. To do this, log into your controller and issue the command: Step 2: Log out and log back in. Step 3: Do the same thing on the node, changing the name to microk8s2. Step 4: Next, you’ll need to add entries for each in the hosts file. Open that file on the controller with the command: Step 5: In that file, you’ll add two entries that look like this — making sure to edit the entries to suit your IP address scheme and domains:

Install microk8s

Step 1: The first thing we must do is install microk8s on both machines. Log into your first machine and install the software with the command: Step 2: Once the installation completes, you’ll need to add your user to the microk8s group with the command: Step 3: Next, create a .kube directory with: Step 4: Give the new directory the necessary permissions with: Step 5: Log out and log back in. Step 6: You can then test the install with the command:

Join nodes

Step 1: On the machine that will serve as your controller, issue the command: Step 2: The output of the above command should include the join command that looks like this: Step 3: Run the join command on your second node. Once the command completes, you can verify the connection on the original node with the command: Step 4: The output of the command should show both nodes are a part of the cluster with output that looks like this: Step 5: One thing to keep in mind is that your Kubernetes cluster must have a minimum of three nodes connected to it in order to implement High Availability. HA will be turned on by default when there are three nodes. You can also add nodes as workers, which can host workloads but do not participate in the cluster’s HA or run the Kubernetes control plan. To join a node as a worker, you’d add the –worker flag at the end of the join command like so: Step 6: The end of that. In less than five minutes, a two-node Kubernetes development cluster has been set up. Since you won’t need to go through the challenging stages of setting up a full-fledged Kubernetes cluster, this is an excellent approach to get started with container programming.

Final Words

We hope you like our article on how to install Kubernetes development cluster with microk8s. One orchestration system that has gained popularity over the past five years is kubernetes. Although it was initially created by Google, its large global community now maintains it. For this reason, it might replace the current container orchestration standard. A Kubernetes cluster, though, can be a little pricey. To launch the cluster and test out numerous sample projects on it, you must have at least two or three nodes running. That might be too much for some people.

How to install Kubernetes development cluster with microk8s - 6How to install Kubernetes development cluster with microk8s - 76How to install Kubernetes development cluster with microk8s - 24How to install Kubernetes development cluster with microk8s - 59