ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect…

Follow publication

What’s new in MicroK8s v1.24?

--

You might look at the Kubernetes v1.24 release announcement and think “that’s an unexciting release” and you might be right! Kubernetes redefined the way the infrastructure is operated and is now in a phase where stability is key to its success. Only small incremental changes will allow its ecosystem to flourish.

MicroK8s builds on the success of Kubernetes and with the v1.24 release puts forward a Kubernetes distribution that you cannot easily ignore. Here is why!

HA storage with Mayastor

Kubernetes solves a very specific problem in a very efficient and elegant way. It hosts containerized services/workloads and under fairly common conditions ensures their high availability. Hosted workloads can scale dynamically to serve fluctuations in demand and are restarted in case of failures. Kubernetes takes care of all the networking and workload placement across the available host machines. To put it simply Kubernetes decides when and where an application will start and creates network rules so that multiple instances of the same application are available through a single endpoint.

OpenEBS with Mayastor solves the problem of distributed storage. Each Kubernetes node contributes part of its local storage resources and Mayastor makes sure data are transparently replicated so that they survive node failures.

When combined, Kubernetes and OpenEBS Mayastor ensure that both the application as well as the data it is using are highly available. Overall a very appealing setup. Try it out with:

sudo snap install microk8s --classic --channel=1.24/stable
sudo microk8s enable mayastor

You will be asked to enable HugePages and to load the nvme-tcp kernel module.

The mayastor storageClass is where you should direct your persistent volume claims to:

# pod-with-pvc.yaml
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
spec:
storageClassName: mayastor
accessModes: [ReadWriteOnce]
resources: { requests: { storage: 5Gi } }
---
apiVersion: v1
kind: Pod
metadata:
name: test-nginx
spec:
volumes:
- name: pvc
persistentVolumeClaim:
claimName: test-pvc
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
volumeMounts:
- name: pvc
mountPath: /usr/share/nginx/html

Of course, to complete your HA setup you will need to have at least three MicroK8s nodes joined in a cluster. To join two nodes snap install microk8s on both of them and call

sudo microk8s add-node

… on the first node. This will print the command you will need to issue on the second node to initiate the microk8s join operation as described in the “create a multinode cluster” how-to.

Addons for everyone

One of the most beloved features of MicroK8s is the microk8s enable foo command with foo being anything you can imagine. You are now able to create custom addons and share them as git repositories. Let me, give you some …food for thought on what is possible in the 1.24 release.

Clone the template addons repository under your github account. In the addons.yaml enter a description for the addon you have in mind. For example:

- name: "pizza"
description: "Need some food for thought?"
version: "1.0.0"
check_status: "${SNAP_DATA}/none"
supported_architectures:
- arm64
- amd64

Create a directory in your repository under addons called pizza. Place an enable file inside the pizza directory and make it executable. In the enable file have the following line:

xdg-open https://www.dominos.com/index.intl.html

Your github repository is a MicroK8s addons repository. Add it to a MicroK8s cluster with something like:

sudo microk8s addons repo add myrepo https://github.com/myorg/myrepo

Order some food with:

sudo microk8s enable pizza

You can read more on how to write addons in the respective microk8s docs.

That’s not all…

The above are the two most exciting features in the v1.24 MicroK8s release. If you are interested to see the long list of what kept us busy in the past few months have a look at the release announcement. Allow me close with a big thank you all the great people that contributed to this release, @balchua, @caleblloyd, @hryyan, @miro-balaz, @balasu, @chris-hamper, @dirien, @AnaisUrlichs.

Links

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

No responses yet

Write a response