Nginx Ingress Integrator
- By Tom Haddon
Channel | Version | Revision | Published | Runs on |
---|---|---|---|---|
latest/stable | 27 | 27 | 08 Mar 2022 | |
latest/edge | 27 | 27 | 25 Feb 2022 |
juju deploy nginx-ingress-integrator
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.nginx_ingress_integrator.v0.ingress
-
- Last updated 04 Feb 2022
- Revision Library version 0
Library for the ingress relation.
This library contains the Requires and Provides classes for handling the ingress interface.
Import IngressRequires
in your charm, with two required options:
- "self" (the charm itself)
- config_dict
config_dict
accepts the following keys:
- service-hostname (required)
- service-name (required)
- service-port (required)
- additional-hostnames
- limit-rps
- limit-whitelist
- max-body-size
- owasp-modsecurity-crs
- path-routes
- retry-errors
- rewrite-enabled
- rewrite-target
- service-namespace
- session-cookie-max-age
- tls-secret-name
See the config section for descriptions of each, along with the required type.
As an example, add the following to src/charm.py
:
from charms.nginx_ingress_integrator.v0.ingress import IngressRequires
# In your charm's `__init__` method.
self.ingress = IngressRequires(self, {"service-hostname": self.config["external_hostname"],
"service-name": self.app.name,
"service-port": 80})
# In your charm's `config-changed` handler.
self.ingress.update_config({"service-hostname": self.config["external_hostname"]})
And then add the following to metadata.yaml
:
requires:
ingress:
interface: ingress
You must register the IngressRequires class as part of the __init__
method
rather than, for instance, a config-changed event handler. This is because
doing so won't get the current relation changed event, because it wasn't
registered to handle the event (because it wasn't created in __init__
when
the event was fired).
Index
class IngressAvailableEvent
class IngressBrokenEvent
class IngressCharmEvents
Description
Custom charm events. None
class IngressRequires
This class defines the functionality for the 'requires' side of the 'ingress' relation.
Description
Hook events observed: - relation-changed
Methods
IngressRequires. __init__( self , charm , config_dict )
IngressRequires. _config_dict_errors( self , update_only )
Description
IngressRequires. _on_relation_changed( self , event )
Description
IngressRequires. update_config( self , config_dict )
Description
class IngressProvides
This class defines the functionality for the 'provides' side of the 'ingress' relation.
Description
Hook events observed: - relation-changed
Methods
IngressProvides. __init__( self , charm )
IngressProvides. _on_relation_changed( self , event )
Handle a change to the ingress relation.
Description
IngressProvides. _on_relation_broken( self , _ )
Description