Deploy Monocular on OpenShift

As a follow-up to Getting started with Helm on OpenShift and Deploy Helm Charts on Minishift’s OpenShift for Local Development, this post provides instructions for deploying Monocular on top of a running OpenShift instance.
I’m assuming you have already deployed Helm (client and server side) within your cluster, for instance using oc cluster up.

Note that this post is solely an illustration of how OpenShift, Monocular, and Helm can run together; Helm and Monocular are not technologies supported by Red Hat. If you are looking for a Red Hat supported way to define and install applications, please see OpenShift Templates and Ansible.

What the Helm is Monocular?

Monocular is a web-based UI for managing Kubernetes applications packaged as Helm Charts.
It allows you to search and discover available charts from multiple repositories, and install them in your cluster with one click.

Instructions

The following commands are used to:

  • To set the DOMAIN variable. Adapt accordingly
  • To set the TILLER_NAMESPACE variable so it indicates in which namespace the server side of helm lives
  • Add the Helm repository containing the Monocular chart.
  • Install Monocular using chart and setting relevant parameters (basically the URL where you can find the API component). We’re also disabling persistence because of some issues that we found
  • Expose routes for both the UI and the API. Note that a route for the API is also needed as per the design of this application.

Also note that we are logging as an admin user, so you will need to have this kind of privileges in your setup.

DOMAIN="192.168.122.106.xip.io"
oc login -u system:admin
export TILLER_NAMESPACE=helm
MONOCULAR_API_URL="monocular-api.$DOMAIN"
MONOCULAR_UI_URL="monocular.$DOMAIN"
MONOCULAR_NAMESPACE="monocular"
oc project $MONOCULAR_NAMESPACE
oc adm policy add-scc-to-user anyuid -z default -n $MONOCULAR_NAMESPACE
helm repo add monocular https://kubernetes-helm.github.io/monocular
helm install --name monocular --set api.config.releasesEnabled=true,ui.backendHostname=http://$MONOCULAR_API_URL,api.config.cors.allowed_origins={http://$MONOCULAR_UI_URL},api.config.tillerNamespace=$TILLER_NAMESPACE,mongodb.persistence.enabled=false monocular/monocular
oc expose svc monocular-monocular-api --hostname=$MONOCULAR_API_URL
oc expose svc monocular-monocular-ui --hostname=$MONOCULAR_UI_URL

Check Monocular is Up

You can use the following to see pods are properly running:

oc get pod
NAME                                             READY     STATUS    RESTARTS   AGE
monocular-mongodb-768848964-56lw6                1/1       Running   0          7m
monocular-monocular-api-1619026850-6xfl2         1/1       Running   2          7m
monocular-monocular-api-1619026850-v2v70         1/1       Running   2          7m
monocular-monocular-prerender-2060794013-4kh2v   1/1       Running   0          7m
monocular-monocular-ui-2454826279-fwffk          1/1       Running   0          7m
monocular-monocular-ui-2454826279-kq06j          1/1       Running   0          7m

Use Monocular

You can now access Monocular using the provided route (monocular.$DOMAIN, in my case) and browse charts and their information.

You can also easily deploy or delete charts.

Conclusion

If you’re deploying your applications using Helm, Monocular provides a convenient way to visualize the metadata of the charts. You get some really good information and actually have the option to deploy straight from the UI. I know there are many options for deployment, but don’t they say the more the merrier!

Categories
OpenShift Container Platform
Tags
,