Loading Posts...

Deploy Applications Easily With Kubeapps On Kubernetes

I’m pretty sure, you already aware of the globally distributed company called Bitnami which is a leader in application packaging solutions providing the largest catalog of “click-to-deploy” applications and development stacks for major cloud and Kubernetes environments. Last year VMware has announced its intention of acquiring Bitnami and it enables VMware customers to easily deploy application packages on any cloud platform. I recently, worked on a project with, application deployment using Kubeapps on Kubernetes and, I believe it is worth of sharing this with my fellow readers. I found it quite useful and “click-to-deploy” saved a massive amounts of time in the application deployment for customers.

I used a Kubernetes cluster with version 1.17.11 for this article with Helm version 3 installed. If you are intending to test this in your own laptop you can use Docker for desktop Kubernetes or a Kind cluster with VMware Fusion. You can find the Kubeapps GitHub repository here. All the instructions were clearly updated in the repository.

Read More:

Below set of commands can be used to set up the helm repository and installing the Kubeapps on Kubernetes. Please check the commands carefully as commands are slightly different with the Helm versions. Kubeapps pods were deployed in a dedicated namespace called “Kubeapps”. To enable the support for the Helm 3 , “useHelm3” value should be set to “true”. These are the commands for my Helm 3 deployment.

#Adding the repository
helm repo add bitnami https://charts.bitnami.com/bitnami

#Updating the repo
helm repo update

#Create the namespace
kubectl create namespace kubeapps

#Installing the helm chart
helm install kubeapps --namespace kubeapps bitnami/kubeapps --set useHelm3=true

In order to access the Kubeapps dashboard, API token and a service account should be required. Service account was created as “kubeapps-operator” and cluster rolebinding was created with the “cluster-admin”.

Note: Adding the cluster role binding with the “cluster-admin” is not recommended for the production grade cluster, please think about a proper restricted access mechanism for production use.

If you are using a Minikube, Kind, or Docker for Desktop cluster you need to export the Kubeapps service for access. The command was auto generated once you installed the Kubeapps with helm.

This was the command for my service.

kubectl port-forward --namespace kubeapps service/kubeapps 8080:80

But, in my case I have previously configured a proper ingress controller solution, and I have exposed Kubeapps service with an ingress resource. Kubeapps service was running on port 80.

Below ingress resource was created to expose this service for external access.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: kubeapps-ingress
  namespace: kubeapps
spec:
  rules:
  - host: kubeapps.techcrumble.cloud
    http:
      paths:
      - backend:
          serviceName: kubeapps
          servicePort: 80
Kubeapps On Kubernetes ingress

Once it loaded on the web browser it will ask you to enter the access token in order for the authentication. Below command used to generate the access token for this.

kubectl get secret $(kubectl get serviceaccount kubeapps-operator -o jsonpath='{range .secrets[*]}{.name}{"\n"}{end}' | grep kubeapps-operator-token) -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' && echo

For windows there is a separate script to get the token and if you are using a windows based system please follow the documentation.

Copy and paste the token and login to the Kubeapps dashboard

After login to the system Kubeapps will show you the installed helm applications in the Kubernetes cluster, in my case I have deployed my Nginx controller using Helm and it was directed and displayed in the dashboard along with the Kubeapps. You can navigate through the namespaces at the top right corner to see the applications or you can see the applications in all the namespaces.

Under the “Catalog” tab it will display the available applications for the deployment. By default it will displayed only the standard Bitnami repository applications.

How To Add A Repository To Kubeapps

Let’s see how we can add a repository to the Kubeapps dashboard and onboard applications for the deployment which are not listed in the standard package library.

“Add Repository” option can be found in the “Configuration” section

Provide the repository “Name” and the “URL” along with the authentication options if required and installed the repository.

Added repository listed as below

The new applications will be listed under the catalog now. I added the “Fluxcd” helm repo and Flux applications are listed with the provider name.

“click-to-deploy” Applications with Kubeapps

I mentioned at the beginning of this article it saved a great amount of time when deploying the applications. Let’s see how we can easily deploy the applications with Kubeapps.

I created a new namespace using the namespace dropdown menu for my new deployment.

Selected the applications in the catalog for the deployment

Basically, application package information will be listed in the page and simple click on “Deploy” will give you the required configurable options.

Parameters can be provided in the next step and, provided the name, version, user, password as well as the ingress url for the external access. For this article purpose I have disabled the persistent volume configuration for this.

You can even verify the pod deployment in the kubernetes cluster with the kubectl but it the dashboard will let you know the pods status and the number of the deployed pods.

Confirmed the status in the kubectl

So in few minutes I would say less than 4 minutes my application was ready to login and I was able to access it through the web browser.

Upgrade Existing Applications

If you need to upgrade the installed applications previously, Kubeapps can help you to do that. My Nginx controller was previously deployed and it was discovered by the Kubeapps. I tried to upgrade that using the Kubeapps upgrade option.

But ended up saying “Chart repositories not found”

After updating the repositories it was able to upgrade the application, so existing applications can easily be upgraded to the newer versions with Kubeapps.

Uninstalling The Applications

Application uninstall also a one-click away and quite simple. Just selected the application and selected the “Delete” option

It asked the purge the release, if you need to completely remove the application it can be done with this option and remove and keep the record will be performed without the option. Quite easy for developers.

Takeaway

Bitnami’s Kubeapps was easy to deploy and easy to manage and also, it makes more easier the application package deployments. Developers can easily spin up the applications on Kubernetes and access them right after the deployment with the self managed ingress resources. It is quite simple, efficient and “click-to-deploy” applications for the developers.

Click to rate this post!
[Total: 3 Average: 5]

Aruna Lakmal

Associate Technical Specialist at Pearson, Sri Lanka. Technology junky, enthusiast, a VMware vExpert and a blogger with more than 7 years of Experience in Information Technology more focusing on VMware Virtualization, Microsoft and Datacenter Technologies.

Get Updates Directly To Your Inbox!

   

Leave a Comment

Loading Posts...