Ceph and COS-lite Integration

Charmed Ceph and COS-lite Howto [OBSOLETE]

Note this page has become obsolete. Up-to-date instructions for COS-lite integration can be found here: https://ubuntu.com/ceph/docs/connecting-to-the-observability-stack

Legacy instructions below.

Overview

Integrating COS-Lite with Charmed Ceph enhances monitoring and alerting capabilities. This integration leverages two features:

  1. Metrics Scraping: COS-Lite can scrape metrics from Charmed Ceph, allowing for monitoring of Ceph’s performance and health.
  2. Alert Rules Transmission: Charmed Ceph can transmit alert rules to COS-Lite. This ensures that COS-Lite can alert administrators about potential issues within the Ceph cluster.

The integration is performed via the metrics-endpoint relation. This relation is established between Prometheus in COS-Lite, and the ceph-mon charm in Charmed Ceph. Through this relation, COS-Lite can receive both metrics and alert rules from Ceph.

Architecture

  • Charmed Ceph: Consists of machine charms deployed within the Ceph Model, operating on physical or virtual machines to manage the Ceph storage cluster

  • COS-lite: Utilizes Kubernetes (k8s) operators for deployment and management

  • Deployment Environment for COS-lite: For the purpose of this integration, COS-lite is assumed to be deployed within a MicroK8s model

  • Cross-Model Relationship: Integration requires establishing a cross-model relationship between the Ceph model and the COS-lite model

Deployment

Prerequisites

For the purposes of this howto, a Juju controller, MicroK8s installation and Charmed Ceph installation are assumed.

For details on installing Charmed Ceph see the Charmed Ceph documentation

Deploying COS-lite

Detailed instructions for deploying COS-lite can be found here. In short, the COS-lite bundle should be installed into a MicroK8s model, and the requisite cross-model offers must be configured.

For convenience, it’s suggested to utilize the included offers overlay for COS-lite:

$ juju add-model cos-model k8s-cloud  # Add a model for COS-lite into microk8s

# Download the offers overlay
$ curl -L https://raw.githubusercontent.com/canonical/cos-lite-bundle/main/overlays/offers-overlay.yaml -O

# Deploy the cos-lite bundle from charmhub, and utilize the offers overlay
$ juju deploy cos-lite --trust --overlay ./offers-overlay.yaml

Relating COS-lite and Ceph

To perform the cross-model relation between COS-lite and Ceph, consume the prometheus-scrape offer from your Ceph model, and relate to ceph-mon

$ juju switch ceph-model  # Switch to your ceph machine model

# Consume the offer from the cos-model. Adjust user and model names
# as necessary
$ juju consume admin/cos-model.prometheus-scrape cos-prometheus

# Relate to ceph-mon
$ juju relate ceph-mon:metrics-endpoint cos-prometheus:metrics-endpoint

This relation should inform Prometheus (in the COS-lite model) to scrape the metrics-endpoint on the ceph-mon application. Also, ceph-mon will transmit alerting rules to Prometheus over this relation.

Metrics and Alert Rules

Documentation about available metrics and default alert rules for Ceph can be found on discourse

Alert rules are implemented as a resource for the ceph-mon charm. This resource can be configured; to upload a new set of rules do:

juju attach ceph-mon alert-rules=./my-prom-alerts.yaml.rules

See the ceph-mon charmhub page for details on the ceph-mon charm, including a download link for the default alert rules.

1 Like

It it possible to use grafana-agent charm to relate to ceph-mon, and then the grafana-agent relates to the cross model Prometheus of cos-lite?

I now see that ceph-mon supports the cos-agent integration, and seems a better way to integrate with the COS stack.

# COS Model
juju consume microk8s:admin/cos.prometheus-receive-remote-write
juju consume microk8s:admin/cos.loki-logging
juju consume microk8s:admin/cos.grafana-dashboards

# Target Ceph model
juju deploy grafana-agent

juju relate grafana-agent cos.prometheus-receive-remote-write
juju relate grafana-agent cos.loki-logging
juju relate grafana-agent cos.grafana-dashboards

juju relate ceph-mon:cos-agent grafana-agent

Thanks @ajames-tibus for this comment – indeed this page has become stale. Updated docs for COS-lite integration can be found here: Observability | Ubuntu

This also describes cos-agent integration.