Traefik Ingress
- By Canonical Observability
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 110 | 31 Jan 2023 | |
latest/candidate | 110 | 25 Jan 2023 | |
latest/beta | 110 | 25 Jan 2023 | |
latest/edge | 126 | 11 May 2023 | |
1.0/stable | 110 | 31 Jan 2023 | |
1.0/candidate | 110 | 25 Jan 2023 | |
1.0/beta | 110 | 25 Jan 2023 | |
1.0/edge | 110 | 25 Jan 2023 |
juju deploy traefik-k8s
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
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.traefik_k8s.v1.ingress
-
- Last updated 09 May 2023
- Revision Library version 1
Interface Library for ingress.
This library wraps relation endpoints using the ingress
interface
and provides a Python API for both requesting and providing per-application
ingress, with load-balancing occurring across all units.
Getting Started
To get started using the library, you just need to fetch the library using charmcraft
.
cd some-charm
charmcraft fetch-lib charms.traefik_k8s.v1.ingress
In the metadata.yaml
of the charm, add the following:
requires:
ingress:
interface: ingress
limit: 1
Then, to initialise the library:
from charms.traefik_k8s.v1.ingress import (IngressPerAppRequirer,
IngressPerAppReadyEvent, IngressPerAppRevokedEvent)
class SomeCharm(CharmBase):
def __init__(self, *args):
# ...
self.ingress = IngressPerAppRequirer(self, port=80)
# The following event is triggered when the ingress URL to be used
# by this deployment of the `SomeCharm` is ready (or changes).
self.framework.observe(
self.ingress.on.ready, self._on_ingress_ready
)
self.framework.observe(
self.ingress.on.revoked, self._on_ingress_revoked
)
def _on_ingress_ready(self, event: IngressPerAppReadyEvent):
logger.info("This app's ingress URL: %s", event.url)
def _on_ingress_revoked(self, event: IngressPerAppRevokedEvent):
logger.info("This app no longer has ingress")
Index
class DataValidationError
Description
Raised when data validation fails on IPU relation data. None
class IngressPerAppDataProvidedEvent
Description
Event representing that ingress data has been provided for an app. None
class IngressPerAppDataRemovedEvent
Description
Event representing that ingress data has been removed for an app. None
class IngressPerAppProviderEvents
Description
Container for IPA Provider events. None
class IngressPerAppProvider
Description
Implementation of the provider of ingress. None
Methods
IngressPerAppProvider. __init__( self , charm: CharmBase , relation_name: str )
Constructor for IngressPerAppProvider.
Arguments
IngressPerAppProvider. wipe_ingress_data( self , relation: Relation )
Description
IngressPerAppProvider. get_data( self , relation: Relation )
Description
IngressPerAppProvider. is_ready( self , relation )
Description
IngressPerAppProvider. publish_url( self , relation: Relation , url: str )
Description
IngressPerAppProvider. proxied_endpoints( self )
Returns the ingress settings provided to applications by this IngressPerAppProvider.
Description
class IngressPerAppReadyEvent
Description
Event representing that ingress for an app is ready. None
class IngressPerAppRevokedEvent
Description
Event representing that ingress for an app has been revoked. None
class IngressPerAppRequirerEvents
Description
Container for IPA Requirer events. None
class IngressPerAppRequirer
Description
Implementation of the requirer of the ingress relation. None
Methods
IngressPerAppRequirer. __init__( self , charm: CharmBase , relation_name: str )
Constructor for IngressRequirer.
Arguments
Description
IngressPerAppRequirer. is_ready( self )
Description
IngressPerAppRequirer. provide_ingress_requirements( self )
Publishes the data that Traefik needs to provide ingress.
Arguments
Description
IngressPerAppRequirer. relation( self )
Description
IngressPerAppRequirer. url( self )
The full ingress URL to reach the current unit.
Description