DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Implementing RBAC Configuration for Kubernetes Applications
  • Kubernetes Package Management With Helm
  • Rapidly Develop Java Microservices on Kubernetes With Telepresence
  • Deploy WordPress on Kubernetes in 15 Minutes Using Helm

Trending

  • How to Ensure Cross-Time Zone Data Integrity and Consistency in Global Data Pipelines
  • Assessing Bias in AI Chatbot Responses
  • Mastering Deployment Strategies: Navigating the Path to Seamless Software Releases
  • How Can Developers Drive Innovation by Combining IoT and AI?
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Quick Application Deployments on MicroK8s Using Helm Charts

Quick Application Deployments on MicroK8s Using Helm Charts

Helm Charts empower super-quick deployments of complex applications on MicroK8s.

By 
Ajit Chelat user avatar
Ajit Chelat
·
Mar. 02, 21 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
9.1K Views

Join the DZone community and get the full member experience.

Join For Free

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 single package you can install by running a single command. 

This article will explain how you can deploy your favorite Helm Chart on MicroK8s in under five 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.

The Setup

In this demo, we'll use the LOGIQ Helm Chart. You can also use your own favorite Helm Chart that you'd like to try out. Let's also assume that you have access to the Linux operating system.

Installing MicroK8s

As a first step, let's install MicroK8s on your machine by running the following commands:

Plain Text
 




x


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


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

Plain Text
 




xxxxxxxxxx
1


 
1
sudo microk8s status


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:

Plain Text
 




xxxxxxxxxx
1


 
1
microk8s enable helm
2
microk8s enable storage
3
microk8s enable dns
4
microk8s enable ingress
5
microk8s enable registry
6
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 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: 

Plain Text
 




xxxxxxxxxx
1


 
1
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


Next, enable MetalLB by running:

Plain Text
 




x


 
1
microk8s enable metallb
2

          
3
Enabling MetalLB
4
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're spinning up an EC2 instance from AWS, MetalLB might not work due to private/public IP configuration. We'll take a closer look at and resolve this issue in another article.

Bring in the Helm Chart

Now that the configuration bits are in place, it's time to bring in your Helm Chart. Like we 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:

Plain Text
 




xxxxxxxxxx
1


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


Bringing Up Our Application

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

Plain Text
 




xxxxxxxxxx
1


 
1
microk8s kubectl create namespace logiq


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

Plain Text
 




xxxxxxxxxx
1


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


Note: The values.yml file used in the command above is customized to suit our cluster's configuration. 

Our application is now ready to go. Before we launch it, let's inspect the pods in your cluster by running the following command in the logiq namespace we created:

Plain Text
 




xxxxxxxxxx
1


 
1
microk8s kubectl get pod -n logiq


We can now access our application 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:

Plain Text
 




xxxxxxxxxx
1


 
1
microk8s kubectl get service -n logiq |grep -i loadbalancer logiq-kubernetes-ingress LoadBalancer 10.152.183.45  192.168.1.2780: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 deployment on MicroK8s using a Helm Chart is up and running! As you can see, Helm Charts make it much easier to deploy complex applications on Kubernetes clusters. Along with superfast deployments, Helm Charts also help you streamline your CI/CD pipeline by automating various tasks that need to be carried out by default which is why we’re such huge fans of it. 

Chart application Kubernetes Plain text Command (computing) cluster

Published at DZone with permission of Ajit Chelat. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Implementing RBAC Configuration for Kubernetes Applications
  • Kubernetes Package Management With Helm
  • Rapidly Develop Java Microservices on Kubernetes With Telepresence
  • Deploy WordPress on Kubernetes in 15 Minutes Using Helm

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!