MicroK8s Addons

To be as lightweight as possible, MicroK8s only installs the basics of a usable
Kubernetes install:

  • api-server
  • controller-manager
  • scheduler
  • kubelet
  • cni
  • kube-proxy

While this does deliver a pure Kubernetes experience with the smallest resource footprint possible, there are situations where you may require additional services. MicroK8s caters for this with the concept of “Addons” - extra services which can easily be added to MicroK8s. These addons can be enabled and disabled at any time, and most are pre-configured to ‘just work’ without any further set up.

For example, to enable the CoreDNS addon:

microk8s enable dns

These add-ons can be disabled at anytime using the disable command:

microk8s disable dns

… and you can check the list of available and installed addons at any time by running:

microk8s status

Note: Before installing add-ons which install extra client tools (e.g. Helm), be sure that the current user is part of the microk8s group, to avoid potential permission problems.

Addon Repositories

Starting from the v1.24 release, addons are organized in repositories. Repositories are essentially git projects in which users can place the addons they are interested in. To assist in creating a such repositories, the MicroK8s team maintains a template repository on github that can be forked to start a new addons collection. Although the template repository includes a HACKING.md guide with instructions on building a Python based demo addon, addons can be implemented in any programming language, even bash.

Addon repositories are found under /var/snap/microk8s/common/addons and can be edited in place. To ease the process of adding, removing and updating such repositories the microk8s addons repo command can be used. A repository under https://github.com/my-org/awesome-repo can be added on a MicroK8s cluster with:

microk8s addons repo add myrepo https://github.com/my-org/awesome-repo

An optional --reference flag can be used to point to a specific branch or tag inside the git repository.

The myrepo in the above example is the repository identifier. This identifier is used to differentiate addons with the same name found on separate addon repositories.

Removing and updating a repository is achieved with the microk8s addons repo remove and microk8s addons repo update commands respectively.

By default the MicroK8s ships with two repositories:

  • core, with essential addons maintained by the MicroK8s team, and

  • community, with community maintained addons.

Note: On fresh installs only the core repository is enabled by default. The community repository can be easily added at any time with: microk8s enable community.

Current MicroK8s Addons

Addons in the Core Repository

The addons maintained and officially supported by the MicroK8s team at Canonical are:

cert-manager: (1.25+ tracks) Certificate management for Kubernetes clusters.

community: (1.24+ tracks) Enables the community addons repository.

dns: Deploys CoreDNS. This add-on may be required by others - it is recommended that this addon is always enabled. In restricted environments you may need to update the upstream DNS servers.

dashboard: The standard Kubernetes Dashboard.

gpu: Enable support for GPU accelerated workloads using the NVIDIA runtime.

ha-cluster: Allows for high availability on clusters with al least three nodes.

helm: Installs the Helm 2 package manager for Kubernetes.

helm3: Installs the Helm 3 package manager for Kubernetes.

hostpath-storage: (1.24+ tracks) Create a default storage class which allocates storage from a host directory. Note!: The hostpath-storage add-on uses simple filesystem storage local to the node where it was added, which is very useful for test deployments and development work. It is not intended to be used in a production environment and is not suitable for clusters.

host-access: Provides a fixed IP for access to the host’s services.

ingress: A simple ingress controller for external access.

kube-ovn: (1.25+ tracks) The feature rich Kube-OVN network fabric.

mayastor: (1.24+ tracks) Multi-node zero-ops storage option powered by Mayastor

metallb: Deploys the MetalLB Loadbalancer. Note that currently this does not work on macOS, due to filtering that macOS applies to network traffic.

metrics-server: Adds the Kubernetes Metrics Server for API access to service metrics.

prometheus: Deploys the Prometheus Operator.

rbac: Enable Role Based Access Control for authorisation. Note that this is incompatible with some other add-ons.

registry: Deploy a private image registry and expose it on localhost:32000. The storage add-on will be enabled as part of this add-on. See the registry documentation for more details.

storage: DEPRECATED since the 1.24 release. Replaced by the hostpath-storage addon. Create a default storage class which allocates storage from a host directory. Note that this is simple filesystem storage local to the node where it was added - you may require something more complex for a cluster.

Addons in the Community Repository

This collection of third party and community maintained addons can be easily enabled with:

microk8s enable community

Here is what is currently included:

ambassador: (1.19+ tracks) Ambassador is an API and Ingress controller.

argocd: (1.24+ tracks) Deploys Argo CD, the declarative, GitOps continuous delivery tool for Kubernetes.

cilium: Deploys Cilium to support Kubernetes network policies using eBPF.

fluentd: Deploy the Elasticsearch-Fluentd-Kibana logging and monitoring solution.

inaccel: (1.23+ tracks) Simplify FPGA management and application lifecycle with InAccel.

istio: Adds the core Istio services (not available on arm64 arch).

jaeger: Deploy the Jaeger Operator in the “simplest” configuration.

juju: The juju addon has been removed with the v1.24 release. MicroK8s will work happily with a locally installed version of Juju.

kata: (1.22+ tracks) Adds Kata containers support - A secure container runtime with lightweight virtual machines that feel and perform like containers.

keda: Deploys KEDA - Kubernetes Event-driven Autoscaling operator.

knative: Adds the Knative middleware to your cluster (not available on arm64 arch).

kubeflow: The kubeflow add-on has been retired as it is now much simpler to just install Kubeflow on MicroK8s as with any other Kubernetes. There is a full end-to-end tutorial for installing Kubeflow with MicroK8s in the Charmed Kubeflow documentation.

linkerd: Deploys the linkerd service mesh ( arm64 version available in 1.20+).

multus: (1.19+ tracks) Add multus for multiple network capability.

nfs: (1.25+ tracks) Adds NFS-based storage.

openebs: Add OpenEBS storage capability, (not available on arm64 arch).

openfaas: OpenFaaS, the popular serverless framework, (not available on arm64 arch).

osm-edge: Open Service Mesh Edge (OSM-Edge) fork from Open Service Mesh is a lightweight, extensible, Cloud Native service mesh built purposely for Edge computing.

portainer: Container management dashboard (see portainer.io).

traefik: (1.20+ tracks) Adds the Traefik Kubernetes Ingress controller.

1 Like

Hi, it seems Linkerd and also Knative is now available for arm64…

From 1.20 MicroK8s linkerd addon is now available on arm.

what is the recommended way to update an add-on on microk8s?
I upgraded my cluster from 1.20 to 1.21 but e.g. dns still uses coredns 1.6.6 instead of 1.8.0.
I didn’t want to disable/enable the add-on to not miss some settings, so i decided to update the used image with microk8s.kubectl set image --namespace kube-system deployment.apps/coredns coredns=coredns/coredns:1.8.0.
Compared to the other microk9s procedures, this looks quite complicated to me.

I know that the dns add-on is very simple, but this was just an example.


@SukramJ Thanks for pointing this out. I don’t know if there is a better way to upgrade an add -on (@kjackal?), but this is definitely something we should mention in the upgrade docs

Pre-configured addons that ‘just work’ are great, but there are times when we might want to configure an addon. It would be useful if this page mentioned how to do so (by editing an addon manifest perhaps?)

1 Like

The hostpath-storage add-on is not intended to be used in a production environment and is not suitable for clusters.

What to use for production then?

I was in fact asking the same question before learning about StorageClasses, PersistentVolumes, PersistentVolumeClaims and all of that stuff.

Getting started

This not not exactly a guide or anything but simply various resources I found out that might help people out.

  1. I was using a custom cloud provider where I could create something called a Block storage which is a fast SSD that I mount to my controller VM.

  2. Once I had a partition ready, I created an NFS Server from that.

  3. I then took a look at NFS Storage provisioning in Kubernetes.

  4. I also started using Helm which has saved my life more than I can count.

Thanks for those resources - indeed, very useful if you need to better understand storage in K8s.
For MicroK8s clusters, the mayastore add-on is a great solution - docs here

1 Like

@Usersina From version 1.25 there is now an nfs addon too

Neat addition! Although I prefer the helm way so it’s easier if I ever want to move to a managed cluster.

1 Like