Using Monocular

I don't think that UIs are useful. We tend to focus on the features they provide, and that distracts us from command line and code. We often get so immersed into filling fields and clicking buttons, that we often forget that the key to automation is to master CLIs and to write code that lives in a code repository. I think that UIs do more damage than good to software engineers.

That being said, I am fully aware that not everyone shares my views. Some like UIs and prefer pretty colors over black and white terminal screens. For those, I will guide you how to get a UI that will utilize Helm repositories and allow you to do some of the things we did through CLI by clicking buttons. We'll explore Monocular (https://github.com/helm/monocular).

Monocular is web-based UI for managing Kubernetes applications packaged as Helm Charts.

It allows us to search and discover available Charts from multiple repositories, and install them in our clusters with one click.

Monocular can be installed with Helm. It is available through a Chart residing in its own repository (https://helm.github.io/monocular/). So, our first step is to add the repository to our Helm client.

 1  helm repo add monocular 
 2      https://helm.github.io/monocular

Let's take a look at the available values.

 1  helm inspect values monocular/monocular

The output, limited to the values we're interested in, is as follows.

api:
  ...
  image:
    repository: bitnami/monocular-api
    tag: v0.7.2
    ...
  resources:
    limits:
      cpu: 100m
      memory: 128Mi
    requests:
      cpu: 100m
      memory: 128Mi
  ...
ui:
  ...
  image:
    repository: bitnami/monocular-ui
    tag: v0.7.2
    ...
ingress:
  enabled: true
  hosts:
  # Wildcard
  -
  # - monocular.local

## Ingress annotations
## annotations: ## Nginx ingress controller (default)
    nginx.ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.class: nginx
    ...

Just as with the other Charts, we'll use a fixed version of the images by customizing image.tag values in both the api and the ui sections.

We'll need to increase the resources since those specified by default are too low.

Ingress is already enabled, but we'll have to specify the host. Also, we'll add the "old" style annotations so that older versions of nginx Ingress are supported as well.

Those changes are already available in the monocular-values.yml file, so let's take a quick look at it.

 1  cat helm/monocular-values.yml

The output is as follows.

api:
  image:
    tag: v0.7.0
  resources:
    limits:
      cpu: 500m
      memory: 1Gi
    requests:
      cpu: 200m
      memory: 512Mi
ui:
  image:
    tag: v0.7.0
ingress:
  annotations:
    kubernetes.io/ingress.class: "nginx"
    ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/rewrite-target: /
    ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/ssl-redirect: "false"

Before we proceed, we'll have to generate a valid hostname that we'll use with Monocular Ingress resource.

 1  MONOCULAR_ADDR="monocular.$LB_IP.nip.io"
2 3 echo $MONOCULAR_ADDR

The output of the latter command should be similar to the one that follows.

monocular.18.221.122.90.nip.io
A note to minishift users
Installing Monocular in OpenShift creates a few issues and requires quite a few changes to the commands that follow. Please use the instructions from Deploy Monocular on OpenShift (https://blog.openshift.com/deploy-monocular-openshift/) article instead of the command that follows.

Now we are ready to install Monocular Chart.

 1  helm install monocular/monocular 
 2      --namespace charts 
 3      --name monocular 
 4      --values helm/monocular-values.yml 
 5      --set ingress.hosts={$MONOCULAR_ADDR}

The output follows the same pattern as the other Charts. It shows the status at the top, followed with the resources it created. At the bottom are short instructions for the post-installation steps.

We should wait until the application rolls out before giving a spin to its UI.

 1  kubectl -n charts 
 2      rollout status 
 3      deploy monocular-monocular-ui

It will take a while until the API rolls out and the monocular-ui Pods might fail a few times. Be patient.

Now we can open Monocular in a browser.

 1  open "http://$MONOCULAR_ADDR"
Figure 5-2: Monocular's home screen

If we click on the Charts link in top-right corner of the screen, we'll see all the charts available in the two default repositories (stable and incubator). We can use the link on the left-hand menu to filter them by a repository and to change the ordering. We can also use the Search charts... field to filter Charts.

The Repositories screen can be used to list those that are currently configured, as well as to add new ones.

The Deployments screen list all the Helm installations. At the moment, we have cm (ChartMuseum) and monocular running through Helm Charts. Additionally, there is the New deployment button that we can use to install a new Chart. Please click it and observe that you are taken back to the Charts screen. We are about to install Jenkins.

Type jenkins in the Search charts... field. The list of the Charts will be filtered, and we'll see only Jenkins. Click on the only Chart.

On the left-hand side of the screen is the same information we can see by executing helm inspect stable/jenkins command. On the right-hand side, there is the Install section which we can use for one click installation or to copy Helm CLI commands.

Please remain in the One Click Installation tab and click the Install jenkins v... button. You will be presented with a popup with a field to specify a Namespace where the Chart will be installed. Please type jenkins and click the Deploy button.

We were redirected to the screen with the same information we'd get if we executed helm install stable/jenkins --namespace jenkins.

Even though using Monocular might seem tempting at the beginning, it has a few serious drawbacks. We'll discuss them soon. For now, please click the red Delete deployment button to remove Jenkins.

The major problem with Monocular is that it does not allow us to specify values during Charts installation. There will hardly ever be the case when we'll install Charts without any custom values. That inability alone should be enough to discard Monocular for any serious usage. On top of that, it does not provide the option to upgrade Charts.

Today (June 2018) Monocular project is still too young to be taken seriously. That will probably change as the project matures. For now, my recommendation is not to use it. That might provoke an adverse reaction. You might feel that I wasted your time by showing you a tool that is not useful. However, I thought that you should know that the UI exists and that it is the only free option we have today. I'll leave that decision to you. You know what it does and how to install it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.176.5