Resource Dispatcher
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| latest/stable | 93 | 13 Sep 2023 | |
| latest/beta | 280 | 10 Mar 2025 | |
| latest/edge | 546 | 13 Feb 2026 | |
| latest/edge | 317 | 05 May 2025 | |
| 2.0/stable | 402 | 30 Oct 2025 | |
| 2.0/stable | 182 | 09 Aug 2024 | |
| 2.0/candidate | 547 | 02 Mar 2026 | |
| 2.0/candidate | 182 | 31 Jul 2025 | |
| 2.0/beta | 547 | 17 Feb 2026 | |
| 2.0/beta | 182 | 09 Aug 2024 | |
| 2.0/edge | 547 | 13 Feb 2026 | |
| 2.0/edge | 277 | 27 Feb 2025 | |
| 1.0/stable | 93 | 13 Sep 2023 | |
| 1.0/beta | 93 | 13 Sep 2023 | |
| 1.0/edge | 186 | 27 Aug 2024 |
juju deploy resource-dispatcher
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
charms.resource_dispatcher.v0.kubernetes_manifests
-
- Last updated 27 Jan 2026
- Revision Library version 0.2
KubernetesManifests Library
This library implements data transfer for the kubernetes_manifest interface. The library can be used by the requirer charm to send Kubernetes manifests to the provider charm. The manifests sent by the requirer using this charm lib is sent encapsulated inside a Juju secret that has been granted to the provider charm on the other side of the relation.
Getting Started
To get started using the library, fetch the library with charmcraft.
cd some-charm
charmcraft fetch-lib charms.resource_dispatcher.v0.kubernetes_manifests
In your charm, the library can be used in two ways depending on whether the manifests being sent by the charm are static (available when the charm starts up), or dynamic (for example a manifest template that gets rendered with data from a relation)
If the manifests are static, instantiate the KubernetesManifestsRequirer. In your charm do:
from charms.resource_dispatcher.v0.kubernetes_manifests import KubernetesManifestsRequirer, KubernetesManifest
# ...
SECRETS_MANIFESTS = [
KubernetesManifest(
Path(SECRET1_PATH).read_text()
),
KubernetesManifest(
Path(SECRET2_PATH).read_text()
),
]
SA_MANIFESTS = [
KubernetesManifest(
Path(SA1_PATH).read_text()
),
KubernetesManifest(
Path(SA2_PATH).read_text()
),
]
class SomeCharm(CharmBase):
def __init__(self, *args):
# ...
self.secrets_manifests_requirer = KubernetesManifestsRequirer(
charm=self, relation_name="secrets", manifests_items=SECRETS_MANIFESTS
)
self.service_accounts_requirer = KubernetesManifestsRequirer(
charm=self, relation_name="service-accounts", manifests_items=SA_MANIFESTS
)
# ...
If the manifests are dynamic, instantiate the KubernetesManifestsRequirerWrapper. In your charm do:
class SomeCharm(CharmBase):
def __init__(self, *args):
# ...
self._secrets_manifests_wrapper = KubernetesManifestsRequirerWrapper(
charm = self,
relation_name = "secrets"
)
self._service_accounts_manifests_wrapper = KubernetesManifestsRequirerWrapper(
charm = self,
relation_name = "service-accounts"
)
self.framework.observe(self.on.leader_elected, self._send_secret)
self.framework.observe(self.on["secrets"].relation_created, self._send_secret)
# observe all the other events for when the secrets manifests change
self.framework.observe(self.on.leader_elected, self._send_service_account)
self.framework.observe(self.on["service-accounts"].relation_created, self._send_service_account)
# observe all the other events for when the service accounts manifests change
def _send_secret(self, _):
#...
Write the logic to re-calculate the manifests
rendered_manifests = ...
#...
manifest_items = [KubernetesManifest(rendered_manifests)]
self._secrets_manifests_wrapper.send_data(manifest_items)
def _send_service_account(self, _):
#...
Write the logic to re-calculate the manifests
rendered_manifests = ...
#...
manifest_items = [KubernetesManifest(rendered_manifests)]
self._service_accounts_manifests_wrapper.send_data(manifest_items)
Index
def generate_secret_label(relation: Relation)
Description
Generate a unique secret label based on the relation name and ID. None
def parse_relation_id_from_secret_label(secret_label: str)
Description
Parse the relation id from a secret label. None
class KubernetesManifest
Representation of a Kubernetes Object sent to Kubernetes Manifests.
Arguments
the content of the Kubernetes manifest file
Methods
KubernetesManifest. __post_init__( self )
Description
Validate that the manifest content is a valid YAML. None
class KubernetesManifestsUpdatedEvent
Description
Indicates the Kubernetes Objects data was updated. None
class KubernetesManifestsEvents
Description
Events for the Kubernetes Manifests library. None
class KubernetesManifestsProvider
Description
Relation manager for the Provider side of the Kubernetes Manifests relations. None
Methods
KubernetesManifestsProvider. __init__( self , charm: CharmBase , relation_name: str , refresh_event )
Relation manager for the Provider side of the Kubernetes Manifests relations.
Arguments
Charm this relation is being used by
Name of this relation (from metadata.yaml)
List of BoundEvents that this manager should handle. Use this to update the data sent on this relation on demand.
Description
This relation manager subscribes to:
- on[relation_name].relation_changed
- secret_changed
- any events provided in refresh_event
This library emits:
- KubernetesManifestsUpdatedEvent: when data received on the relation (either as plaintext or as secret) is updated
KubernetesManifestsProvider. is_secret_enabled( self , relation: Relation )
Description
Return whether secret support is enabled for this relation. None
KubernetesManifestsProvider. get_manifests( self )
Description
Returns a list of manifest dictionaries sent in the data of relation relation_name. If this relation supports sharing data over Juju secrets, the secret is decoded on-the-fly to return the actual list of manifest dictionaries.
KubernetesManifestsProvider. register_secrets_to_relation( self , relation: Relation )
Description
Register the secret received in the relation with a label (local to this application). This is necessary because afterwards in secret-changed, we reference this secret with its local label.
class KubernetesManifestsRequirer
Description
Relation manager for the Requirer side of the Kubernetes Manifests relation. None
Methods
KubernetesManifestsRequirer. __init__( self , charm: CharmBase , relation_name: str , manifests_items , refresh_event )
Relation manager for the Requirer side of the Kubernetes Manifests relation.
Arguments
Charm this relation is being used by
Name of this relation (from metadata.yaml)
List of KubernetesManifest objects to send over the relation
List of BoundEvents that this manager should handle. Use this to update the data sent on this relation on demand.
Description
This relation manager subscribes to:
on.leader_elected: because only the leader is allowed to provide this data, and relation_created may fire before the leadership election
on[relation_name].relation_created
any events provided in refresh_event
This library emits:
- (nothing)
class KubernetesManifestRequirerWrapper
Description
Wrapper for the relation data sending logic None
Methods
KubernetesManifestRequirerWrapper. __init__( self , charm: CharmBase , relation_name: str )
KubernetesManifestRequirerWrapper. send_data( self , manifest_items )
Description
Sends the manifests data to the relation in json format. None
def get_name_of_breaking_app(relation_name: str)
Description
Get the name of a remote application that is leaving the relation during a relation broken event by checking Juju environment variables. If the application name is available, returns the name as a string; otherwise None.