Mimir Coordinator K8S
- Canonical Observability
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 12 | 04 Jun 2024 | |
latest/candidate | 12 | 22 May 2024 | |
latest/beta | 24 | 19 Nov 2024 | |
latest/edge | 29 | Today |
juju deploy mimir-coordinator-k8s
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.mimir_coordinator_k8s.v0.mimir_cluster
-
- Last updated 19 Feb 2024
- Revision Library version 0.2
This file defines the schemas for the provider and requirer sides of this relation interface.
It must expose two interfaces.schema_base.DataBagSchema subclasses called:
- ProviderSchema
- RequirerSchema
TODO: see https://github.com/canonical/charm-relation-interfaces/issues/121
Index
class MimirClusterError
Description
Base class for exceptions raised by this module. None
class DataValidationError
Description
Raised when relation databag validation fails. None
class DatabagAccessPermissionError
Description
Raised when a follower attempts to write leader settings. None
class DatabagModel
Description
Base databag model. None
Methods
DatabagModel. load( cls , databag )
Description
Load this model from a Juju databag. None
DatabagModel. dump( self , databag , clear: bool )
Write the contents of this model to Juju databag.
Arguments
the databag to write the data to.
ensure the databag is cleared before writing it.
class DataBagSchema
Base class for relation interface databag schemas.
Description
Subclass from this base class and override "unit" and/or "app" to create a specification for a databag schema.
For example:
from pydantic import Json
class MyUnitConsumerSchema(DataBagSchema): foo: Json[int] bar: str
this class needs to be named "ConsumerSchema"
for it to be picked up by the automated tester.
class ConsumerSchema(DataBagSchema): unit: MyUnitConsumerSchema
This specifies that for a relation to satisfy MyRequirerSchema, the application databag needs to be empty and the unit databag needs to contain exactly a "bar":string and a "foo":Json-encoded int value.
By using pydantic's validator API, you can specify further constraints on the values, provide defaults, enforce encoding/decoding, and more.
class MimirRole
Description
Mimir component role names. None
def expand_roles(roles)
Description
Expand any meta roles to their 'atomic' equivalents. None
class MimirClusterProviderAppData
class ProviderSchema
Description
The schema for the provider side of this interface. None
class JujuTopology
class MimirClusterRequirerUnitData
class MimirClusterRequirerAppData
class RequirerSchema
Description
The schema for the requirer side of this interface. None
class MimirClusterProvider
Methods
MimirClusterProvider. __init__( self , charm , key , endpoint: str )
MimirClusterProvider. publish_data( self , mimir_config , loki_endpoints )
Description
Publish the mimir config and loki endpoints to all related mimir worker clusters. None
MimirClusterProvider. gather_roles( self )
Description
Go through the worker's app databags and sum the available application roles. None
MimirClusterProvider. gather_addresses_by_role( self )
Description
Go through the worker's unit databags to collect all the addresses published by the units, by role. None
MimirClusterProvider. gather_addresses( self )
Description
Go through the worker's unit databags to collect all the addresses published by the units. None
MimirClusterProvider. get_datasource_address( self )
MimirClusterProvider. gather_topology( self )
class MimirClusterRemovedEvent
Event emitted when the relation with the "mimir-cluster" provider has been severed.
Description
Or when the relation data has been wiped.
class ConfigReceivedEvent
Description
Event emitted when the "mimir-cluster" provider has shared a new mimir config. None
Methods
ConfigReceivedEvent. __init__( self , handle , config )
ConfigReceivedEvent. snapshot( self )
Used by the framework to serialize the event to disk.
Description
Not meant to be called by charm code.
ConfigReceivedEvent. restore( self , snapshot )
Used by the framework to deserialize the event from disk.
Description
Not meant to be called by charm code.
class MimirClusterRequirerEvents
Description
Events emitted by the MimirClusterRequirer "mimir-cluster" endpoint wrapper. None
class MimirClusterRequirer
Methods
MimirClusterRequirer. __init__( self , charm , key , endpoint: str )
MimirClusterRequirer. is_published( self )
Verify that the local side has done all they need to do.
Description
- unit address is published
- roles are published
MimirClusterRequirer. publish_unit_address( self , url: str )
Description
Publish this unit's URL via the unit databag. None
MimirClusterRequirer. publish_app_roles( self , roles )
Description
Publish this application's roles via the application databag. None
MimirClusterRequirer. get_mimir_config( self )
Description
Fetch the mimir config from the coordinator databag. None
MimirClusterRequirer. get_loki_endpoints( self )
Description
Fetch the loki endpoints from the coordinator databag. None
MimirClusterRequirer. get_cert_secret_ids( self )
Description
Fetch certificates secrets ids for the mimir config. None