Closed phvalguima closed 3 months ago
The only solution we see at the moment is to add to the charm a juju resource that follows the naming of promtail and deploy the charm with it. We have to think about it some more to see if there's a less work-intensive solution.
If for k8s we must run promtail alongside each workload, then I suggest we make the resource_name argument mandatory. That enforces charm developers to look into the resource and specify it.
Sorry for "reusing" this bug but just a brief mention to VM charms: it seems that we can get away by adding the resource directly in the grafana-agent charm itself, as it is a subordinate charm.
Another alternative is to ship promtail embedded on snap/rocks by default. That can be tricky on snaps, depending on the levels of access it needs to the system. For k8s it would be a good solution. In this case, LogProxyConsumer class would seek the path defined as argument or fail right away if not found. That would be a good warning to the charm developer that it has missed something.
Another option is to add a dump
section for promtail in charmcraft.yaml
. This way:
However, this would require:
@taurus-forever, what's your take on this? Would it make sense for you to add promtail as a resource or as a dump
section in charmcraft.yaml?
@benhoyt, is it possible in charm code to launch a pebble service on the charm container? E.g. python3 -m http.server 8000, to serve a file from the charm container.
@sed-i I believe the charm container now runs its own Pebble, so I suppose you could. I don't know too much about how it's configured, but you'd have to figure out how to talk to the charm container's Pebble to add a new layer with the service in it.
Why do you want to serve the promtail binary, though? Is it so _download_and_push_promtail_to_workload
can access it via a URL? That seems kinda roundabout ... I think it'd be better to "just" include the binary/binaries in the charm, or as a charm resource.
Thanks @benhoyt The idea is to serve the promtail binary in the loki pod and the grafana agent pod, because it's a dependency that other charms need, not us. Currently, the charm lib on the other side of the relation downloads promtail automatically. In air-gapped, this is tricky, and one workaround is serving it ourselves.
It seems too much to ask other charm authors to include "3rd party build artifacts" (promtail) in their flow.
Bug Description
Promtail download fails in airgapped setups with:
To Reproduce
Environment
AWS, juju 3.4
Relevant log output
Additional context
No response