monocular

by joaquinito2051

Helm chartv0.6.4App v0.7.3

Monocular is a search and discovery front end for Helm Charts Repositories.

About this chart

Monocular

Monocular is 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.

TL;DR;

$ helm repo add monocular https://helm.github.io/monocular
$ helm install monocular/monocular

Introduction

This chart bootstraps a Monocular deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

Nginx Ingress controller

To avoid issues with Cross-Origin Resource Sharing, the Monocular chart sets up an Ingress resource to serve the frontend and the API on the same domain. This is used to route requests made to <host>:<port>/ to the frontend pods, and <host>:<port>/api to the backend pods.

It is possible to run Monocular on separate domains and without the Nginx Ingress controller, see the configuration section on how to do this.

Installing the Chart

First, ensure you have added the Monocular chart repository:

$ helm repo add monocular https://helm.github.io/monocular

To install the chart with the release name my-release:

$ helm install --name my-release monocular

The command deploys Monocular on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

See the values for the full list of configurable values.

Pointing to a different namespace

If tiller is not running in default namespace kube-system, you can provide the correct namespace with the following:

$ helm install monocular/monocular --set api.config.tillerNamespace=YOUR_NAMESPACE

Disabling Helm releases (deployment) management

If you want to run Monocular without giving the option to install and manage charts in your cluster, similar to KubeApps you can configure api.config.releasesEnabled:

$ helm install monocular/monocular --set api.config.releasesEnabled=false

Configuring chart repositories

You can configure the chart repositories you want to see in Monocular with the api.config.repos value, for example:

$ cat > custom-repos.yaml <<<EOF
api:
  config:
    repos:
      - name: stable
        url: https://kubernetes-charts.storage.googleapis.com
        source: https://github.com/kubernetes/charts/tree/master/stable
      - name: incubator
        url: https://kubernetes-charts-incubator.storage.googleapis.com
        source: https://github.com/kubernetes/charts/tree/master/incubator
      - name: monocular
        url: https://helm.github.io/monocular
        source: https://github.com/helm/monocular/tree/master/charts
EOF

$ helm install monocular/monocular -f custom-repos.yaml

Serve Monocular on a single domain

You can configure the Ingress object with the hostnames you wish to serve Monocular on:

$ cat > custom-domains.yaml <<<EOF
ingress:
  hosts:
  - monocular.local
EOF

$ helm install monocular/monocular -f custom-domains.yaml

Serve Monocular frontend and API on different domains

In order to serve the frontend and the API on different domains, you need to configure the frontend with the API location and configure CORS correctly for the API to accept requests from the frontend.

To do this, you can use the ui.backendHostname and api.config.cors.allowed_origins values. You should also disable the Ingress resource and manually configure each hostname to point to the pods.

$ cat > separate-domains.yaml <<<EOF
ingress:
  enabled: false
api:
  config:
    cors:
      allowed_origins:
        - http://$FRONTEND_HOSTNAME
ui:
  backendHostname: http://$API_HOSTNAME
EOF

$ helm install monocular/monocular -f separate-domains.yaml

Ensure that you replace $FRONTEND_HOSTNAME and $API_HOSTNAME with the hostnames you want to use.

Other configuration options

ValueDescriptionDefault
api.livenessProbe.initialDelaySecondsIncrease this if the API pods are crashing due to the chart repository sync taking too long180
api.config.releasesEnabledEnable installing and managing charts in the clustertrue
api.config.cacheRefreshIntervalHow often to sync with chart repositories3600
api.nodeSelectorNode labels for pod assignment{}
api.tolerationsTolerations for pod assignment[]
api.affinityNode/Pod affinities{}
ui.googleAnalyticsIdGoogle Analytics IDUA-XXXXXX-X (unset)
ui.appNameName to use in title bar and headerMonocular
ui.nodeSelectorNode labels for pod assignment{}
ui.tolerationsTolerations for pod assignment[]
ui.affinityNode/Pod affinities{}
ingress.enabledIf enabled, create an Ingress objecttrue
ingress.annotationsIngress annotations{ingress.kubernetes.io/rewrite-target: /, kubernetes.io/ingress.class: nginx}
ingress.tlsTLS configuration for the Ingress objectnil

Deploy monocular with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has monocular on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmonocular is pinned at v0.6.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply