Deploy the COS Lite observability stack on MicroK8s

Key Value
Summary Deploy the COS Lite observability stack on MicroK8s.
Categories deploy-applications
Difficulty 2
Author Leon Mintz


Duration: 1:00

The COS Lite bundle is a Juju-based observability stack consisting of Prometheus, Loki, Alertmanager and Grafana.

This tutorial assumes you have a JuJu controller bootstrapped on a MicroK8s cloud that is ready to use. A typical setup using snaps can be found in the Juju docs. Follow the instructions there to install Juju and MicroK8s.

Let’s go and deploy that bundle!

Deploy the COS Lite bundle

Duration: 5:00

Before deploying anything you must have a Juju model. It is usually a good idea to create a dedicated model for the COS Lite bundle. So let’s do just that and call the new model cos:

juju add-model cos
juju switch cos

Next, deploy the bundle with:

juju deploy cos-lite \
  --channel=edge \

Now you can sit back and watch the deployment take place:

juju status \
  --relations \
  --color \
  --watch 2s

The status of your deployment should eventually be very similar to the following:

> juju status --relations
Model  Controller  Cloud/Region        Version  SLA          Timestamp
cos    cos-uk8s    microk8s/localhost  2.9.15   unsupported  16:53:38-00:00

App            Version  Status  Scale  Charm                         Store     Channel  Rev  OS          Address         Message
alertmanager            active      1  alertmanager-k8s              charmhub  edge       6  kubernetes  
grafana                 active      1  grafana-k8s                   charmhub  edge      10  kubernetes  
loki                    active      1  loki-k8s                      charmhub  edge       6  kubernetes    
prometheus              active      1  prometheus-k8s                charmhub  edge      10  kubernetes  

Unit              Workload  Agent  Address     Ports  Message
alertmanager/0*   active    idle         
grafana/0*        active    idle         
loki/0*           active    idle         
prometheus/0*     active    idle         

Relation provider               Requirer                                Interface              Type     Message
alertmanager:alerting           prometheus:alertmanager                 alertmanager_dispatch  regular  
alertmanager:replicas           alertmanager:replicas                   alertmanager_replica   peer     
grafana:grafana-peers           grafana:grafana-peers                   grafana_peers          peer     
loki:grafana-source             grafana:grafana-source                  grafana_datasource     regular  
prometheus:grafana-source       grafana:grafana-source                  grafana_datasource     regular  

Now COS Lite is good to go: you can relate software with it to begin the monitoring!

Alternatively, you may want to deploy the bundle with one or more of our readily available overlays, which is what we’ll cover next.

Deploy the COS Lite bundle with overlays

Duration: 2:00

An overlay is a set of model-specific modifications that avoid repetitive overhead in setting up bundles like COS Lite.

Specifically, we offer the following overlays:

You can apply the offers overlay do an existing COS Lite bundle by executing the juju deploy command. The storage-small overlay, however, is applicable only on the first deployment. So, if you were following the previous steps you would first need to switch to a new Juju model or remove all applications from the current one.

To use any of the overlays above, you need to include an --overlay argument per overlay (applied in order):

curl -L -O
curl -L -O

juju deploy cos-lite \
  --trust \
  --channel=edge \
  --overlay ./offers-overlay.yaml \
  --overlay ./storage-small-overlay.yaml

Browse dashboards

Duration: 2:00

When all the charms are deployed you can head over to browse their built-in web-UIs. You can find out their addresses from juju status, which should have a section similar to:

Unit              Workload  Agent  Address     Ports  Message
alertmanager/0*   active    idle         
grafana/0*        active    idle         
loki/0*           active    idle         
prometheus/0*     active    idle         

In this case, the dashboards would be something like:

  •, for alertmanager
  •, for grafana
  •, for prometheus

(Note: the IP addresses are almost certainly going to be different in your case.)


That’s all folks!

Congrats, you made it! You should now be able to easily:

  • deploy the COS Lite observability stack
  • augment the COS Lite bundle file with ready-made overlays
  • find the URLs of the web-UI dashboards

Next steps

Further readings

1 Like

Updated article to reflect the renaming of LMA Light to COS Lite