Run your favourite HELM chart using MicroK8s in 5 minutes

Sandesh hegde
4 min readFeb 16, 2021

Helm is a Kubernetes package manager that helps you find, share, and use software built for Kubernetes. With Helm Charts, you can bundle Kubernetes deployments into a package and install by firing a single command. We will use Logiq helm chart for quick deployment of the LOGIQ observability platform in this article. You could also use any other helm chart to implement the same.

This article will explain how you can deploy your favourite Helm Chart on MicroK8s in under 5 minutes.

What is MicroK8s

MicroK8s is a lightweight, pure-upstream Kubernetes aiming to reduce entry barriers for K8s and cloud-native application development. It comes in a single package that installs a single-node (standalone) K8s cluster in under 60 seconds. While MicroK8s has all the Kubernetes core components, it is also opinionated, which means that many of the add-ons you would typically look for in Kubernetes, such as DNS, Helm, registry, storage, etc. are all a single command away.

What is LOGIQ

LOGIQ is a complete observability platform for monitoring, log aggregation, and analytics with infinite storage scale. Logiq uses AWS S3 (or S3 compatible storage) as primary storage for data at rest, It allows to send logs from Kubernetes or on-prem servers or cloud virtual machines with ease.

The LOGIQ platform includes:

  • A User Interface (UI)
  • A command-line toolkit
  • A monitoring stack for time-series metrics, and
  • A log analytics stack for log data.

Now that we’ve got you acquainted with MicroK8s and LOGIQ , why don’t we jump right into the integration?

Installing MicroK8s

We assume that you have access to a Linux operating system (Ubuntu below). As a first step, let’s install MicroK8s on your machine by running the following commands:

sudo apt-get -y update
sudo snap install core
sudo snap install microk8s --classic
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
sudo microk8s config > ~/.kube/config

Now, let’s check whether MicroK8s is up and running or not with the command:

sudo microk8s status

Note: If you have issues with access Mircrok8s cluster locally without sudo, please see this https://github.com/ubuntu/microk8s/blob/feature/dev-docs/docs/access-without-sudo.md

Enabling add-ons

Now that we have MicroK8s up and running, let’s set up your cluster and enable the add-ons that MicroK8s readily provides, like Helm, DNS, ingress, storage, and private registry. These add-ons can be enabled and disabled at any time, and most are pre-configured to work without any additional setup. Run the following commands to enable add-ons:

microk8s enable helm
microk8s enable storage
microk8s enable dns
microk8s enable ingress
microk8s enable registry
microk8s.kubectl config view > $HOME/.kube/config

Provisioning an IP address

We need an endpoint or an IP address to access the application we’re spinning up. This endpoint can either be within or outside our cluster. For this, let’s leverage MetalLB — a Kubernetes-aware solution that can monitor for services with the type LoadBalancer and assign them an IP address. Alternatively, you can also set an IP address while enabling add-ons.

While provisioning an IP address, you can use your local machine’s IP address, which pulls up the stack at IP-address:80. If you do not know your local machine’s IP address, run the ifconfig command as shown below and use the output of the command:

ifconfig:
wlp60s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.27 netmask 255.255.255.0 broadcast 192.168.1.255
microk8s enable metallb
Enabling MetalLB
Enter each IP address range delimited by comma (e.g. '10.64.140.43-10.64.140.49,192.168.0.105-192.168.0.111'): 192.168.1.27-192.168.1.27

Note: If you are spinning up an EC2 instance from AWS, MetalLB might not work due to private/public IP configuration, another article will be published for the same.

Bring in the Helm Chart

Now that the configuration bits are in place, it’s time to bring in your Helm Chart. Like I mentioned above, we’re using the logiq Helm Chart and Helm 3 in the following commands. You can replace the Helm Chart repo URL in the following command with your own Helm Chart’s repo URL if you’re trying another chart.

Run:

helm repo add logiq-repo https://logiqai.github.io/helm-charts
helm repo update

Bringing up LOGIQ

Next, let’s create a namespace called logiq for the stack to spin up from and start running with the command:

Microk8s kubectl create namespace logiq

And then run helm install with the storage class set to the microk8s-hostpath as shown below:

helm install logiq -n logiq --set global.persistence.storageClass=microk8s-hostpath  logiq-repo/logiq -f values.yaml  --debug  --timeout 6m

Note: The values.yml file used in the command above is customised to suit our cluster’s configuration. You can download the values.yml file from docs.logiq.ai and edit it to suit your cluster’s needs, and then run the above command.

LOGIQ is now ready to go! let’s inspect the pods in your cluster by running the following command in the logiq namespace you created:

Run the below:

microk8s kubectl get pod -n logiq

We can now access the LOGIQ UI by hitting the MetalLB endpoint we defined earlier in this article. To find the endpoint, let’s search for the LoadBalancer service that knows which IP address MicroK8s exposes.

Run the command:

microk8s kubectl get service -n logiq |grep -i loadbalancer
logiq-kubernetes-ingress LoadBalancer 10.152.183.45 192.168.1.27
80:30537/TCP,20514:30222/TCP,24224:30909/TCP,24225:31991/TCP,2514:30800/TCP,3000:32680/TCP,514:32450/TCP,7514:30267/TCP,8081:30984/TCP,9998:31425/TCP 18m

Now, using the web browser you love, navigate to the IP address shown by the LoadBalancer service above: http://192.168.1.27:80

And voila! Our LOGIQ Helm deployment is up and running!

My next article will focus on how to make K8s deployments using Helm Charts easier by automating it. We’ll go through how you can use a CloudFormation template to run Helm Charts on MicroK8s. Keep watching this space!

--

--