What the Helm is Monocular?

Miguel Martinez Trivino

Miguel Martinez Trivino


Share this article

Making container-based applications easier to deploy on Kubernetes is the mission of Helm, which has done a great job of creating a package manager for Kubernetes applications.

In addition, the Helm project has created a set of definitions to make it easier to deploy and configure applications on Kubernetes (Helm Charts).  Helm Charts make installing new applications on Kubernetes as easy as running helm install <chart-name>.

However, discovering available Helm Charts, and important details about them, is not as easy as it could be.  

Enter Monocular, an open source search and discovery front-end for Helm Chart repositories, developed by Bitnami and Deis.  Monocular is part of the Helm project and aims to provide a better way to find apps that have been packaged in Helm Charts.

You can check out Monocular by visiting kubeapps.com, a website maintained by Bitnami to promote the use of Helm and Kubernetes. It points to the official Helm Charts repositories and is deployed automatically using Jenkins on Google Container Engine (GKE).

Monocular Architecture

Monocular includes a scanning back-end for indexing charts and their metadata and a simple user interface.

Monocular Overview

Backend:

The backend is a golang HTTP RESTFul server whose purpose is to ingest and index existing Chart repositories, process and store its metadata, and expose it via a JSON API.

Highlights:

  • Stateless, metadata is stored in memory and processed cache in local disk.
  • API code generated from a Swagger spec using GoSwagger.

Components:

  • Ingestor: Currently, Monocular is configured to index the Stable and Incubator official chart repositories. Checking for new or updated content every 15 minutes.
  • Metadata processor: During the repository ingestion, some assets are processed and stored locally. For example, we download the chart Icon, process it to match our format requirements and then store those results in the filesystem cache.
  • JSON API: Once a repository is indexed, the Charts and its versions get exposed via a JSON API. You can find the API Swagger spec here.
  • Static assets web server: Readme Files and icons are exposed via the backends built in http server under the /assets prefix.

API call examples:

Get all charts:

https://kubeapps.com/api/v1/charts

Get all charts from the stable repository:

https://kubeapps.com/api/v1/charts/stable

Get the versions for Wordpress

https://kubeapps.com/api/v1/charts/stable/wordpress/versions

Download Wordpress Readme file

https://kubeapps.com/api/assets/stable/wordpress/0.4.2/README.md

Frontend:

The frontend is a Web UI focused on application discoverability via repository listing, chart version information and search capabilities.

Highlights:

  • Angular2 single page application bootstrapped using Angular CLI and built on top of Webpack.
  • Using Typescript and SCSS. More info about the stack here.
  • Angular components based UI.Monocular
  • At deployment time, the code is built using –aot and –production flags and bundled with an NGINX web server.

Components:

The UI implements three main sections:

Charts listing: To be able to get a list of all the charts or filtered by repository.

Monocular Charts search: Search engine capable of match the query with some of the existing metadata like name, description, maintainers, keywords and so on. Monocular Chart details: To be able to get the Readme information for a specific chart along with its versions, installation instructions and other metadata. Monocular

Continuous integration

The Monocular repository is configured to use Travis to perform a set of integration tasks on every pull request. For both the backend and the frontend code we run its tests, expose its coverage and build its production assets.

How do I deploy Monocular in my cluster?

Monocular is available as a Helm Chart and can be deployed in your Kubernetes cluster following these instructions.

Developing locally on Monocular

It’s easy to run Monocular locally by using the Docker Compose file and instructions you can find here.

How to Contribute?

Acknowledgements

Learn more

Watch the following demo to learn how to deploy your favorite open source applications on Kubernetes with a single command:

Want to reach the next level in Kubernetes?

Contact us for a Kubernetes Training