canonical / pvcviewer-operator

Charm PVCViewer for visualizing PVC content
Apache License 2.0
2 stars 0 forks source link

Add logging relation to pvcviewer #45

Closed rgildein closed 1 month ago

rgildein commented 1 month ago

Use LogForwarder from loki_push_api library to forwards all logs from workload container to Loki. This requires to use ops 2.9 or newer, so it was needed to be updated.

fixes: #40

How I tested it:

# deployed the cos following https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s
$ tox -e integration -- --keep-models --model kubeflow
$ juju consume u1-k8s:cos.loki-logging 
Added u1-k8s:admin/cos.loki-logging as loki-logging
$ juju integrate grafana-agent-k8s loki-logging
$ charmcraft pack
'config.yaml' is not a valid config file.
'config.yaml' is not a valid config file.
Created 'pvcviewer-operator_ubuntu-20.04-amd64.charm'.
Charms packed:
    pvcviewer-operator_ubuntu-20.04-amd64.charm
$ juju deploy ./pvcviewer-operator_ubuntu-20.04-amd64.charm --resource oci-image=docker.io/kubeflownotebookswg/pvcviewer-controller:v1.9.0-rc.0 --resource oci-image-proxy=gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
Located local charm "pvcviewer-operator", revision 0
Deploying "pvcviewer-operator" from local charm "pvcviewer-operator", revision 0 on ubuntu@20.04/stable
$ juju integrate  grafana-agent-k8s pvcviewer-operator:logging

And after checking the Grafana, I was able to see all logs. Screenshot from 2024-07-10 15-06-36