> Alternatively, the charm can default to the internal storage and if the db relation is added, it falls back to its previous behavior.
I was thinking in a similar behavior.
This is the way I think things could work and allow us to have a different set of storage backends.
you deploy vault, add the relations you want (if any), then you initialize it, when the charm detects that vault was initialized, then at that point considers that those are the relations that will be used from now now. At the moment there is no action to initialise vault and this happens outside the charm's control, this should change probably.
After the action "initialise" is run the charm would get into waiting state if any of the relations is removed.
Scenario 1:
juju deploy vault
juju add-relation etcd vault
juju run-action vault/0 initialise # at this point etcd is used for storage
Scenario 2:
juju deploy vault
juju add-relation etcd vault
juju add-relation vault-mysql-router vault
juju run-action vault/0 initialise # at this point etcd is used for leadership and mysql for storage.
Scenario 3:
juju deploy vault
juju add-relation vault-mysql-router vault
juju run-action vault/0 initialise # at this point mysql is used for storage
Scenario 4:
juju deploy vault
juju run-action vault/0 initialise # at this point vault's internal storage is used.
> Alternatively, the charm can default to the internal storage and if the db relation is added, it falls back to its previous behavior.
I was thinking in a similar behavior.
This is the way I think things could work and allow us to have a different set of storage backends.
you deploy vault, add the relations you want (if any), then you initialize it, when the charm detects that vault was initialized, then at that point considers that those are the relations that will be used from now now. At the moment there is no action to initialise vault and this happens outside the charm's control, this should change probably.
After the action "initialise" is run the charm would get into waiting state if any of the relations is removed.
Scenario 1:
juju deploy vault
juju add-relation etcd vault
juju run-action vault/0 initialise # at this point etcd is used for storage
Scenario 2:
juju deploy vault
juju add-relation etcd vault
juju add-relation vault-mysql-router vault
juju run-action vault/0 initialise # at this point etcd is used for leadership and mysql for storage.
Scenario 3:
juju deploy vault
juju add-relation vault-mysql-router vault
juju run-action vault/0 initialise # at this point mysql is used for storage
Scenario 4:
juju deploy vault
juju run-action vault/0 initialise # at this point vault's internal storage is used.