Skip to content

Commit

Permalink
migrate to nginx_route
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrkiller committed Jan 8, 2024
1 parent bca3a66 commit 22882d1
Show file tree
Hide file tree
Showing 10 changed files with 473 additions and 47 deletions.
4 changes: 2 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ options:
site:
type: string
description: >
Required if no ingress-proxy relation is established. The site name, e.g. "mysite.local".
Required if no nginx-proxy relation is established. The site name, e.g. "mysite.local".
If the backend is set and this option is empty then the site will default to the application
name.
backend:
type: string
description: >
Required if no ingress-proxy relation is established. The backend to use for site, e.g. "http://mybackend.local:80".
Required if no nginx-proxy relation is established. The backend to use for site, e.g. "http://mybackend.local:80".
default: ""
backend_site_name:
type: string
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This is because the Content-cache-k8s charm isn't integrated with Hello-kubecon
Provide integration between Content-cache-k8s and Hello-kubecon by running the following [`juju relate`](https://juju.is/docs/olm/juju-relate) command:

```bash
juju relate content-cache-k8s:ingress-proxy hello-kubecon
juju relate content-cache-k8s:nginx-proxy hello-kubecon
```

Run `juju status` to see that the message has changed:
Expand All @@ -51,7 +51,7 @@ content-cache-k8s/0* active idle 10.1.97.227 Ready
hello-kubecon/0* active idle 10.1.97.193
```

Note: `ingress-proxy` is the name of the relation. You can run `juju info content-cache-k8s` to check what are the relation names provided by the Content-cache-k8s application and `juju status --relations` to see the relations currently established in the model.
Note: `nginx-proxy` is the name of the relation. You can run `juju info content-cache-k8s` to check what are the relation names provided by the Content-cache-k8s application and `juju status --relations` to see the relations currently established in the model.

The deployment finishes when the status shows "Active".

Expand Down
10 changes: 5 additions & 5 deletions lib/charms/nginx_ingress_integrator/v0/ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
from ops.model import BlockedStatus

INGRESS_RELATION_NAME = "ingress"
INGRESS_PROXY_RELATION_NAME = "ingress-proxy"
INGRESS_PROXY_RELATION_NAME = "nginx-proxy"

# The unique Charmhub library identifier, never change it
LIBID = "db0af4367506491c91663468fb5caa4c"
Expand Down Expand Up @@ -295,14 +295,14 @@ def __init__(self, charm: CharmBase, relation_name: str) -> None:
"""Init function for the IngressProxyProvides class.
Args:
charm: The charm that provides the ingress-proxy relation.
charm: The charm that provides the nginx-proxy relation.
relation_name: The name of the relation.
"""
super().__init__(charm, relation_name)
self.charm = charm

def _on_relation_changed(self, event: RelationChangedEvent) -> None:
"""Handle a change to the ingress/ingress-proxy relation.
"""Handle a change to the ingress/nginx-proxy relation.
Confirm we have the fields we expect to receive.
Expand Down Expand Up @@ -396,7 +396,7 @@ def _on_relation_broken(self, event: RelationBrokenEvent) -> None:


class IngressProxyProvides(IngressBaseProvides):
"""Class containing the functionality for the 'provides' side of the 'ingress-proxy' relation.
"""Class containing the functionality for the 'provides' side of the 'nginx-proxy' relation.
Hook events observed:
- relation-changed
Expand All @@ -406,7 +406,7 @@ def __init__(self, charm: CharmBase) -> None:
"""Init function for the IngressProxyProvides class.
Args:
charm: The charm that provides the ingress-proxy relation.
charm: The charm that provides the nginx-proxy relation.
"""
super().__init__(charm, INGRESS_PROXY_RELATION_NAME)
# Observe the relation-changed hook event and bind
Expand Down
Loading

0 comments on commit 22882d1

Please sign in to comment.