Explain about how the juju charms hooks files working (Life Cycle)

300 Views Asked by At
  • How many juju charms hooks files are there ? what are they important ?

  • Can anyone please explain about how the juju charms hooks files working ?

  • what are the orders to be executed ?

  • Explain about life-cycle about juju charms hooks ?

2

There are 2 best solutions below

0
On

They have some good documentation now.

Lifecycle of the events: https://juju.is/docs/sdk/a-charms-life
Events that can trigger relational hooks: https://juju.is/docs/sdk/integration

0
On

Hooks are simple scripts called during the lifecycle of a service. They are triggered either by commands run (like "deploy") or events (like a relation with another service going down).

All hooks are optional, but they are the points where you take control of what the charm actually needs to do.

To me it seems strange that a complete lifecycle graph is not available, so I created one below from what I understand:

enter image description here

Note that this is gathered by just reading the docs, it might not correspond 100% with how the actual code is run.