<container>-pebble-ready event is emitted once the Pebble sidecar container has started and a socket is available. There is one
<container>-pebble-ready event for each container defined in
metadata.yaml. This event allows the charm to configure how services should be launched.
This event is specific to Kubernetes sidecar charms and is only ever fired on Kubernetes deployments.
pebble-ready event doesn’t guarantee the workload container is still up. For example, if you manually
kubectl patch during (for example)
install, then you may receive this event after the old workload is down but before the new one is up.
For this reason it’s essential, even in
pebble-ready event handlers, to guard with
Container.can_connect() to check that the socket is up. Do note that this is a point-in-time check, so just because
True doesn’t mean it will still return
True at a later time.
When using the
ops library, you can observe the event like you would any other:
self.framework.observe( self.on.<container>_pebble_ready, self._on_pebble_ready, )
Last updated 2 months ago.