hardware-observer docs howto - integrate with cos

Integrate with COS

Prerequisites

Bootstrap a juju controller on a microk8s cloud. Steps can be found in this guide.

Note: This is a separate controller from the one managing the Hardware Observer charm. We plan to build a cross model integration here.

Deploy COS-Lite

Follow these steps to set up cos-lite on microk8s: Deploy cos-lite on microk8s

Ensure to set up cos-lite with this offers overlay so that the COS model is ready for cross model relations. Relevant section in the above guide here.

Deploy Grafana-Agent

Deploy the grafana-agent machine charm in the same model as Hardware Observer. This will be used for scraping the prometheus metrics and exporting them to Prometheus in the COS model via cross-model-relations.

For more information on the usage of grafana-agent machine charm, see here.

# switch from microk8s model to the Hardware Observer one

juju switch other-controller:hw-obs-model

juju deploy grafana-agent

juju relate hardware-observer:cos-agent grafana-agent:cos-agent

Verify if the status of juju units is expected:

  • hardware-observer should in active status, if all the required resources/configurations are been provided.
  • grafana-agent should in blocked status because the required juju integration haven’t been provided.

The required integration can be provided by the juju offers. Verify if the offers from the COS model are visible.

# verify if offers are present

juju find-offers -m microk8s-controller:cos-model

Then add the necessary relations with the grafana-agent charm.

# add cross-model relations

juju relate grafana-agent cos.prometheus

juju relate grafana-agent cos.grafana

Now the architecture looks like below:

Check the dashboard

As described in this section of the COS docs, you can navigate to the dashboards for Prometheus and Grafana, and verify whether the metrics and alert rules from Hardware Observer are present.