Designate Bind K8S
- OpenStack Charmers
Channel | Revision | Published | Runs on |
---|---|---|---|
9/stable | 4 | 06 Dec 2023 | |
9/candidate | 14 | 25 Mar 2024 | |
9/beta | 45 | 11 Dec 2024 | |
9/beta | 40 | 22 Nov 2024 | |
9/edge | 45 | 09 Dec 2024 | |
9/edge | 40 | 07 Oct 2024 |
juju deploy designate-bind-k8s --channel 9/stable
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.designate_bind_k8s.v0.bind_rndc
-
- Last updated 03 Oct 2023
- Revision Library version 0.1
BindRndc Provides and Requires module.
This library contains the Requires and Provides classes for handling
the bind_rndc interface.
Import BindRndcRequires
in your charm, with the charm object and the
relation name:
- self
- "dns-backend"
Two events are also available to respond to:
- bind_rndc_ready
- goneaway
A basic example showing the usage of this relation follows:
from charms.designate_bind_k8s.v0.bind_rndc import (
BindRndcRequires
)
class BindRndcClientCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
# BindRndc Requires
self.bind_rndc = BindRndcRequires(
self, "dns-backend"
)
self.framework.observe(
self.bind_rndc.on.bind_rndc_ready,
self._on_bind_rndc_ready
)
self.framework.observe(
self.bind_rndc.on.goneaway,
self._on_bind_rndc_goneaway
)
def _on_bind_rndc_connected(self, event):
'''React to the Bind Rndc Connected event.
This event happens when BindRndc relation is added to the
model.
'''
# Request the rndc key from the Bind Rndc relation.
self.bind_rndc.request_rndc_key("generated nonce")
def _on_bind_rndc_ready(self, event):
'''React to the Bind Rndc Ready event.
This event happens when BindRndc relation is added to the
model, relation is ready and/or relation data is changed.
'''
# Do something with the configuration provided by relation.
pass
def _on_bind_rndc_goneaway(self, event):
'''React to the BindRndc goneaway event.
This event happens when BindRndc relation is removed.
'''
# BindRndc Relation has goneaway.
pass
Index
class BindRndcConnectedEvent
Description
Bind rndc connected event. None
Methods
BindRndcConnectedEvent. __init__( self , handle , relation_id: int , relation_name: str )
BindRndcConnectedEvent. snapshot( self )
Description
Return snapshot data that should be persisted. None
BindRndcConnectedEvent. restore( self , snapshot )
Description
Restore the value state from a given snapshot. None
class BindRndcReadyEvent
Description
Bind rndc ready event. None
Methods
BindRndcReadyEvent. __init__( self , handle , relation_id: int , relation_name: str )
BindRndcReadyEvent. snapshot( self )
Description
Return snapshot data that should be persisted. None
BindRndcReadyEvent. restore( self , snapshot )
Description
Restore the value state from a given snapshot. None
class BindRndcGoneAwayEvent
Description
Bind rndc gone away event. None
class BindRndcRequirerEvents
Description
List of events that the BindRndc requires charm can leverage. None
class BindRndcRequires
Description
Class to be instantiated by the requiring side of the relation. None
Methods
BindRndcRequires. __init__( self , charm , relation_name: str )
BindRndcRequires. host( self , relation )
Description
Return host from relation. None
BindRndcRequires. nonce( self , relation )
Description
Return nonce from relation. None
BindRndcRequires. get_rndc_key( self , relation )
Description
Get rndc keys. None
BindRndcRequires. request_rndc_key( self , relation , nonce: str )
Description
Request rndc key over the relation. None
class NewBindClientAttachedEvent
Description
New bind client attached event. None
Methods
NewBindClientAttachedEvent. __init__( self , handle , relation_id: int , relation_name: str )
NewBindClientAttachedEvent. snapshot( self )
Description
Return snapshot data that should be persisted. None
NewBindClientAttachedEvent. restore( self , snapshot )
Description
Restore the value state from a given snapshot. None
class BindClientUpdatedEvent
Description
Bind client updated event. None
Methods
BindClientUpdatedEvent. __init__( self , handle , relation_id: int , relation_name: str )
BindClientUpdatedEvent. snapshot( self )
Description
Return snapshot data that should be persisted. None
BindClientUpdatedEvent. restore( self , snapshot )
Description
Restore the value state from a given snapshot. None
class BindRndcProviderEvents
Description
List of events that the BindRndc provider charm can leverage. None
class BindRndcProvides
Description
Class to be instantiated by the providing side of the relation. None
Methods
BindRndcProvides. __init__( self , charm , relation_name: str )
BindRndcProvides. set_host( self , relation , host: str )
Description
Set host on the relation. None
BindRndcProvides. get_rndc_keys( self , relation )
Description
Get rndc keys. None
BindRndcProvides. set_rndc_client_key( self , relation , client: str , algorithm: str , secret )
Add rndc key to the relation.
Description
rndc_keys
is a dict of dicts, keyed by client name. Each client
has an algorithm and secret property. The secret is a Juju secret id,
containing the actual secret needed to communicate over rndc.
BindRndcProvides. remove_rndc_client_key( self , relation , client )
Description
Remove rndc key from the relation. None