MicroK8s is a lightweight, zero-ops Kubernetes distribution 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.

  1. Install Kubernetes on your local machine.
  2. Clone the microk8s repository and install it on your local machine.
  3. Create a new project in your favorite project management tool and name it “microk8s”.
  4. Add the following lines to your project’s file: KUBE_VERSION=1.10 KUBE_CLUSTER_NAME=my-cluster KUBE_HOSTNAME=my-server KUBE_PORT=8080 KUBE_USERNAME=root # Set up a new namespace for your microk8s cluster $ kubectl create -n my-cluster -f my-namespace

Steps to install Kubernetes development cluster with microk8s

Set up hostnames

k8s-cli set-hostname microk8s1 k8s-cli set-hostname microk8s2

Step 3: Click on the “My Account” link in the top left corner of your screen. Step 4: In the “My Account” section, click on the “Sign In” button. Step 5: In the next window, enter your username and password. Step 6: Click on the “Log In” button.

Step 3: Change the name of the node to microk8s2.

sudo nano /etc/hosts Add the following lines at the bottom of the file: 127.0.0.1 localhost 192.168.1.1 controller 192.168.2.1 web01 192.168.3.1 web02 Save and close the file when you’re done. ..

192.168.1.1 192.168.2.1 Now you’ll need to create a file called “hosts” in your home directory and add the following lines: 192.168.1.1 localhost 192.168.2.1 localhost You can now restart your computer and test the setup by visiting http://localhost in your browser ..

Install microk8s

sudo apt-get install microk8s Step 2: Next, we need to create a new user for our microk8s environment. Log into your first machine and create a new user called “admin” with the following command: sudo useradd -m -G admin microk8s Step 3: Finally, we need to set up a security group for our microk8s environment. Log into your first machine and create a new group called “microk8s” with the following command: sudo groupadd -G microk8s security

sudo usermod -a -G microk8s ..

mkdir -p .kube chmod 777 .kube

chmod -R 777 ~/new_directory This will give the new directory the necessary permissions to be used as a working directory. ..

Step 5: Log out and log back in. ..

sudo apt-get install python-apt This will install the Python package manager and enable you to install and manage Python packages.

Join nodes

Step 2: The machine will start to spin, and you’ll see a screen that says “Please enter your name.” Step 3: On the screen, type in your name and press ENTER. Step 4: The machine will ask you to confirm your name, and you’ll type in your confirmation code. Step 5: The machine will print out a receipt for your purchase, and you’ll sign it.

join -f “SELECT * FROM users” This will join all the tables in the users table into a single table, and output the result to the console.

join -n 2 my-node This will join two nodes together, and you can then use the commands on the new node to view and control the data on the original node.

The output of the command should show both nodes are a part of the cluster and that they are both up and running.

kubeadm join –worker node1 If you want to add a node as a control plane node, you’d use the –control-plane flag like so: kubeadm join –control-plane node1 ..

In less than five minutes, a two-node Kubernetes development cluster has been set up. This is an excellent approach to get started with container programming.

Final Words

If you’re looking for a Kubernetes development cluster that you can launch on a single machine, microk8s might be the right orchestration system for you. Microk8s is a lightweight orchestration system that runs on top of Kubernetes. It makes it possible to launch a Kubernetes development cluster on a single machine. This means that you can test out your projects without having to purchase or set up multiple nodes. ..