canonical / oidc-gatekeeper-operator

Charmed OIDC Gatekeeper
Apache License 2.0
1 stars 7 forks source link

Add logging relation to oidc-gatekeeper #155

Closed rgildein closed 2 months ago

rgildein commented 3 months 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: #152

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 switch kubeflow
$ charmcraft pack
Created 'oidc-gatekeeper_ubuntu-20.04-amd64.charm'.

Charms packed:

    oidc-gatekeeper_ubuntu-20.04-amd64.charm
# need to refresh back to local build of charm
$ juju refresh oidc-gatekeeper --path ./oidc-gatekeeper_ubuntu-20.04-amd64.charm 
Added local charm "oidc-gatekeeper", revision 1, to the model
adding endpoint "logging" to default space "alpha"
no change to endpoints in space "alpha": client-secret, ingress, ingress-auth, oidc-client
$ juju consume u1-k8s:cos.loki-logging
$ juju integrate grafana-agent-k8s loki-logging
$ juju integrate oidc-gatekeeper:logging grafana-agent-k8s 

And after checking the Grafana, I was able to see all logs. Screenshot from 2024-07-04 18-58-05

Note: I updated all packages for integrations tests, since there was old juju and pytest-operator used, causing some warning. IMO it's ok, since such update do not have any effect to charm functionality.

orfeas-k commented 3 months ago

Let's also make sure to fix the PR's (and commit's) title