removing relation between kubernetes-master:vault-kv and vault:secrets doesn't work properly

Bug #1844103 reported by Seyeong Kim on 2019-09-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kubernetes Master Charm
Undecided
Cory Johns

Bug Description

I deployed k8s with vault,

then removed relation between kubernets-master and vault

juju remove-relation kubernetes-master:vault-kv vault:secrets

then i faced error hook failed: "vault-kv-relation-departed"

error inside unit is below [1]

so I analyzed a bit then found that layer.vault-kv.ready is remained.

I removed it and juju resolved kubernetes-master/0 then it went stable status

juju run --unit kubernetes-master/0 -- "charms.reactive clear_flag layer.vault-kv.ready"

I think removing relation is not supported properly.

or I missed something else?

Thanks.

[1] ##########################################################################
2019-09-16 08:40:20 ERROR juju-log vault-kv:19: Hook error: Traceback (most recent call last): File "/var/lib/juju/agents/unit-kubernetes-master-0/.venv/lib/python3.6/site-packages/charms/reactive/__init__.py", line 73, in main bus.dispatch(restricted=restricted_mode) File "/var/lib/juju/agents/unit-kubernetes-master-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 390, in dispatch _invoke(other_handlers) File "/var/lib/juju/agents/unit-kubernetes-master-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 359, in _invoke handler.invoke() File "/var/lib/juju/agents/unit-kubernetes-master-0/.venv/lib/python3.6/site-packages/charms/reactive/bus.py", line 181, in invoke self._action(*args) File "/var/lib/juju/agents/unit-kubernetes-master-0/charm/reactive/kubernetes_master.py", line 2251, in generate_encryption_key app_kv = vault_kv.VaultAppKV() File "lib/charms/layer/vault_kv.py", line 25, in __call__ cls._singleton_instance = super().__call__(*args, **kwargs) File "lib/charms/layer/vault_kv.py", line 96, in __init__ self._path = '{}/kv/app'.format(self._config['secret_backend']) File "lib/charms/layer/vault_kv.py", line 43, in _config _VaultBaseKV._config = get_vault_config() File "lib/charms/layer/vault_kv.py", line 201, in get_vault_config raise VaultNotReady() charms.layer.vault_kv.VaultNotReady

Tags: sts Edit Tag help
Seyeong Kim (xtrusia) on 2019-09-16
description: updated
Cory Johns (johnsca) wrote :

There is a handler to clear the ready flag [1] but I think there is a timing issue with it due to the fact that other handlers might run between when the connected flag is removed and when that handler would run. I think the solution to this would be to use triggers [2], but we may also need to include the available flag in addition to connected. Also, the interface layer should probably also be migrated to use manage_flags [3] to improve the timing of the connected and available flags themselves, as well.

[1]: https://github.com/juju-solutions/layer-vault-kv/blob/master/reactive/vault_kv.py#L40-L43
[2]: https://charmsreactive.readthedocs.io/en/latest/triggers.html
[3]: https://charmsreactive.readthedocs.io/en/latest/charms.reactive.relations.html#charms.reactive.endpoints.Endpoint.manage_flags

Cory Johns (johnsca) wrote :
Changed in charm-kubernetes-master:
status: New → In Progress
assignee: nobody → Cory Johns (johnsca)
Changed in charm-kubernetes-master:
status: In Progress → Fix Committed
milestone: none → 1.16
Changed in charm-kubernetes-master:
status: Fix Committed → Fix Released
Cory Johns (johnsca) wrote :

The interface PR has not been merged yet. Not sure why this got changed to released.

Changed in charm-kubernetes-master:
milestone: 1.16 → 1.16+ck2
status: Fix Released → Fix Committed
status: Fix Committed → In Progress
Changed in charm-kubernetes-master:
milestone: 1.16+ck2 → 1.16+ck3
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers