Charmed Redis K8s
- Canonical
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 7 | 12 May 2021 | |
latest/edge | 38 | 11 Nov 2024 | |
latest/edge | 23 | 05 Dec 2022 |
juju deploy redis-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.redis_k8s.v0.redis
-
- Last updated 11 Nov 2024
- Revision Library version 0.7
Library for the redis relation.
This library contains the Requires and Provides classes for handling the redis interface.
Import RedisRequires
in your charm by adding the following to src/charm.py
:
from charms.redis_k8s.v0.redis import RedisRequires
Define the following attributes in charm charm class for the library to be able to work with it
on = RedisRelationCharmEvents()
And then wherever you need to reference the relation data it will be available
in the property relation_data
:
redis_host = self.redis.relation_data.get("hostname")
redis_port = self.redis.relation_data.get("port")
You will also need to add the following to metadata.yaml
:
requires:
redis:
interface: redis
Index
class RedisRelationUpdatedEvent
Description
An event for the redis relation having been updated. None
class RedisRelationCharmEvents
Description
A class to carry custom charm events so requires can react to relation changes. None
class RedisRequires
Methods
RedisRequires. __init__( self , charm , relation_name: str )
Description
A class implementing the redis requires relation. None
RedisRequires. app_data( self )
Retrieve the app data.
Returns
dict containing the app data.
RedisRequires. relation_data( self )
Retrieve the relation data.
Returns
dict containing the relation data.
RedisRequires. url( self )
Retrieve the Redis URL.
Returns
the Redis URL.
class RedisProvides
Methods
RedisProvides. __init__( self , charm , port )
Description
A class implementing the redis provides relation. None