COS configuration

  • By Canonical Observability
Channel Revision Published Runs on
latest/stable 15 31 Jan 2023
Ubuntu 20.04
latest/candidate 15 25 Jan 2023
Ubuntu 20.04
latest/beta 15 25 Jan 2023
Ubuntu 20.04
latest/edge 38 31 Jul 2023
Ubuntu 20.04
1.0/stable 15 31 Jan 2023
Ubuntu 20.04
1.0/candidate 15 25 Jan 2023
Ubuntu 20.04
1.0/beta 15 25 Jan 2023
Ubuntu 20.04
1.0/edge 15 25 Jan 2023
Ubuntu 20.04
juju deploy cos-configuration-k8s
Show information

Platform:

COS Configuration Repository Operator for Kubernetes

This charmed operator for Kubernetes enables you to provide configurations to various components of the Canonical Observability Stack (COS) bundle.

Supported configurations

The charm facilitates forwarding freestanding files from a git repository to the following operators:

Internally, the charm is using git-sync to sync a remote repo with the local copy. The repo syncs on update-status or when the user manually runs the sync-now action.

Getting started

Deployment

juju deploy cos-configuration-k8s \
  --config git_repo=https://path.to/repo \
  --config git_branch=main \
  --config git_depth=1 \
  --config prometheus_alert_rules_path=rules/prod/prometheus/

juju relate cos-configuration-k8s prometheus-k8s

Paths to rules files etc. can also be set after deployment:

juju config cos-configuration-k8s loki_alert_rules_path=rules/prod/loki/
juju relate cos-configuration-k8s loki-k8s

juju config cos-configuration-k8s grafana_dashboards_path=dashboards/prod/grafana/
juju relate cos-configuration-k8s grafana-k8s

Verification

After setting the git_repo (and optionally git_branch), the contents should be present in the workload container,

$ juju ssh --container git-sync cos-configuration-k8s/0 ls -l /git
total 4
drwxr-xr-x 6 root root 4096 Oct 24 08:59 7f0b1eac9317850aee320b4f47a7f1527aaff625
lrwxrwxrwx 1 root root   40 Oct 24 08:59 repo -> 7f0b1eac9317850aee320b4f47a7f1527aaff625

and accessible from the charm container

$ juju ssh cos-configuration-k8s/0 ls -l /var/lib/juju/storage/content-from-git/0
total 4
drwxr-xr-x 6 root root 4096 Oct 24 08:59 7f0b1eac9317850aee320b4f47a7f1527aaff625
lrwxrwxrwx 1 root root   40 Oct 24 08:59 repo -> 7f0b1eac9317850aee320b4f47a7f1527aaff625

After relating to e.g. prometheus, rules from the synced repo should appear in app data,

juju show-unit promethus-k8s/0 --format json | jq '."prometheus-k8s/0"."relation-info"' 

as well as in prometheus itself

juju ssh prometheus-k8s/0 curl localhost:9090/api/v1/rules

OCI Images

This charm can be used with the following image:

  • k8s.gcr.io/git-sync/git-sync:v3.5.0


Help us improve this documentation

Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.

Last updated 5 months ago. Help improve this document in the forum.