How to deploy Portainer to a MicroK8s environment


If you wish to include Kubernetes to your development workflow, try the easy route with this Microk8s and Portainer mix.

A developer writes code on multiple screens. Image: Gorodenkoff/Adobe Stock Blink and innovation modifications. It was only a number of months ago that I wrote a TechRepublic tutorial on releasing Portainer to a Microk8s cluster for simplified Kubernetes development. Now that tutorial no longer works, because the current versions of Microk8s have trouble clustering, and the variations of Microk8s prior to 1.24 won’t work with Portainer. Keep reading to find out the new process of releasing this all-in-one container management platform to a Microk8s cluster.

SEE: Hiring set: Back-end Developer (TechRepublic Premium)

What you need to release Portainer to Microk8s

You’ll need a Microk8s cluster with a minimum of 3 nodes and a user with sudo opportunities.

How to set up Microk8s and join the cluster

Here’s a fast refresher on how to release a Microk8s cluster correctly.

  1. Set up version 1.24 of Microk8s on all Ubuntu Server nodes through breeze.
  2. Modify your/ etc/hosts submit to map hostnames to IP addresses.
  3. Set the hostnames for each device.
  4. Set the proper timezone on all devices.
  5. Run the microk8s add-node command on the controller.
  6. Run the microk8s sign up with command, shown in the output of the add-node command, on every node.
  7. Add your user to the microk8s group with sudo usermod -aG microk8s $USER.
  8. Change the permission of the.kube folder with chown -f -R $USER ~/. kube.
  9. Log out and log back in.

Now that you have your cluster up and running, it’s time to deploy Portainer to the cluster.

How to release Portainer to a Microk8s cluster

Initially, enable a few add-ons to Microk8s. Log in to your Microk8s controller and issue the following commands to allow the essential add-ons:

microk8s make it possible for dns

microk8s enable ha-cluster

microk8s make it possible for ingress

microk8s allow metrics-server

microk8s make it possible for rbac

microk8s make it possible for hostpath-storage

Before allowing Portainer, you must allow the neighborhood repository with the command:

microk8s allow community

Now, you can enable Portainer with:

microk8s allow portainer

Offer Portainer adequate time to spin up– you can examine the status with the following command:

microk8s kubectl get pods -n portainer

When you see Portainer noted as running, you can open a web internet browser and point it to http://SERVER:30777 or https://SERVER:30799, where SERVER is the IP address or domain of the hosting server.

You will be triggered to create an admin user. After you take care of that, select the local environment, and you’ll discover yourself on the Portainer Control Panel (Figure A), where you can start managing your Kubernetes releases.

Figure A

The Portainer Dashboard as seen on a Microk8s cluster. The Portainer Control panel as seen on a Microk8s

cluster. Watch for the latest releases of Microk8s Now you know how to appropriately deploy Portainer to a Microk8s cluster; however, given that this could change, you ought to expect the latest releases of Microk8s on the Snap shop. As soon as the most recent steady version of Microk8s is better capable of clustering, I extremely advise you upgrade to that release and re-deploy Portainer.


Leave a Reply

Your email address will not be published. Required fields are marked *