Create private Helm Charts repository with ChartMuseumUI

In this article I will show you how to create your very own private charts repository using ChartMuseumUI.
But first, a little introduction…

Containers are nothing new in the infrastructure world, we are using Docker containers to package up code that has been built & thoroughly tested in a continuous integration environment. This containers will then execute on any server (cloud and on premise) that require Docker host only.
To scale your application and run containers on multiple servers, you will need a container orchestration tool, if you didn’t know, Kubernetes had become de-facto standard for orchestrating and managing containerized apps in production environments.
Once you begin embracing microservices, or if you want to place your infrastructure in a container, you need to find a way to not only scale your application but to install, configure, upgrade, and run the application in a matter of minutes.

Helm

If you ever used a package manager, for example apt/yum/brew then I bet you already know how important they are and how they provide an easy way for installing, upgrading, configuring, and removing applications.
Helm is the package manager for the Kubernetes.

Helm is the first Kubernetes-based package installer. It manages Kubernetes “charts”, which are “preconfigured packages of Kubernetes resources”.
It allows describing the application structure through convenient helm-charts and managing it with simple commands.
Adoption of Helm might well be the key to mass adoption of micro-services, as using this package manager simplifies their management greatly:

  • Easy application deployment
  • Standardized and reusable
  • Improves developer productivity
  • Reduces deployment complexity
  • Enhances operational readiness
  • Speeds up the adoption of cloud native app

Great tool right? I strongly recommend you to look at Helm-Cheatsheet for more information and examples for working with Helm.

Chart repository

The main global charts repository is located here and contains two folders:

  • Stable
  • Incubator

The purpose of this repository is to provide a place for maintaining and contributing official Charts, with CI processes in place for managing the release of Charts into the Chart Repository.
Stable Charts meet the criteria in the technical requirements.
Incubator Charts are those that do not meet these criteria. Having the incubator folder allows charts to be shared and improved until they are ready to be moved into the stable folder.

Demo

Prerequisite

In this demo we will use ChartMuseum for creating and managing our charts repository and ChartMuseumUI web app to easily view our charts on the browser.
We will be using docker-compose so that and helm client installed is our only prerequisites.

ChartMuseum

ChartMuseum is an open-source for creating and managing your very own charts repository. The real power in this tool is the ability to choose the storage type from a wide variety.

ChartMuseum have support for cloud storage backends, including Google Cloud Storage, Amazon S3, Microsoft Azure Blob Storage, Alibaba Cloud OSS Storage and Openstack Object Storage.

ChartMuseumUI

ChartMuseumUI is a simple web app that provides GUI for your charts so you and your team can upload/delete, view and share the technologies you are using with any one at any time (in near future more capabilities will be added).
ChartMuseumUI was written in Go (Golang) with the help of Beego Framework.

Deploy

tl:dr

combine-gif

The following docker-compose file is defining ChartMuseum with Amazon S3 as a storage and exposing ChartMuseumUI on port 80

version: '2.0'
services:
   ui:
     image: idobry/chartmuseumui:latest
     environment:
      CHART_MUSESUM_URL: "http://chartmuseum:8080"
     ports:
      - 80:8080
   chartmuseum:
     image: chartmuseum/chartmuseum:latest
     volumes:
       - ~/.aws:/root/.aws:ro
     restart: always
     environment:
      PORT: 8080
      DEBUG: 1
      STORAGE: "amazon"
      STORAGE_AMAZON_BUCKET: "chartmuseum-bucket"
      STORAGE_AMAZON_PREFIX: ""
      STORAGE_AMAZON_REGION: "eu-west-1"
     ports:
      - 8080:8080

Copy this file and run:

$ docker-compose up

Easy, right? Now, we can add our private repository to our Helm client:

# choose any name you like
$ helm repo add chartmuseum <chartmuseum-url>
$ helm repo update
# to view our repos list
$ helm repo list NAME URL stable https://kubernetes-charts.storage.googleapis.com incubator http://storage.googleapis.com/kubernetes-charts-incubator chartmuseum http://localhost:8080

Let’s upload a chart into our private repository using the terminal:

$ cd /chart/path
# create a chart package - this will create a .tgz file
$ helm package .
# copy packge name and run
$ curl -L --data-binary "@<packge-name>" <chartmuseum-url>/api/charts

Or, we can have it over to the browser and navigate to localhost using ChartMuseumUI:

usage-gif

ChartMuseumUI is at an early stage of development, Therefor code contributions are very welcome. If you are interested in helping make ChartMuseumUI great then you are more than welcome! Visit the project on GitHub.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: