Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Dummy changes to some charms to trigger upload action
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezfdezjavier committed Apr 6, 2022
1 parent 19e4ddd commit 027df7c
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 37 deletions.
2 changes: 1 addition & 1 deletion orchestrator-bundle/nms-magmalte-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _on_get_admin_credentials(self, event: ActionEvent) -> None:

def _create_nms_admin_user(self, email: str, password: str, organization: str):
"""
Creates Admin user for the master organization in NMS
Creates Admin user for the master organization in NMS.
"""
logger.info("Creating admin user for NMS")
process = self._container.exec(
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-analytics-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MagmaOrc8rAnalyticsCharm(CharmBase):

def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down
60 changes: 34 additions & 26 deletions orchestrator-bundle/orc8r-bundle/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# magma-orc8r

## Overview
Orchestrator is a Magma service that provides a simple and consistent way to
configure and monitor the wireless network securely. The metrics acquired through the platform

Orchestrator is a Magma service that provides a simple and consistent way to
configure and monitor the wireless network securely. The metrics acquired through the platform
allows you to see the analytics and traffic flows of the wireless users through the Magma web UI.

## Usage

In order for the bundle to be deployed with your domain, we need to create an overlay bundle file.
In order for the bundle to be deployed with your domain, we need to create an overlay bundle file.
This file should contain the following:

```yaml
applications:
orc8r-certifier:
options:
domain: <your domain>

```
An example with the same content is provided in `overlay_examples/self_signed_certs.yaml` and you
can read more about overlay bundles
An example with the same content is provided in `overlay_examples/self_signed_certs.yaml` and you
can read more about overlay bundles
[here](https://discourse.charmhub.io/t/how-to-manage-charm-bundles/1058#heading--overlay-bundles).
An example for the case where you'd want to provide your own certificates is also presented.

Deploy the `magma-orc8r` bundle specifying your overlay bundle file.

```bash
juju deploy magma-orc8r --overlay ~/self_signed_certs.yaml --trust
```
Expand All @@ -32,7 +33,7 @@ juju deploy magma-orc8r --overlay ~/self_signed_certs.yaml --trust

### Create Orchestrator admin user

The NMS requires some basic certificate-based authentication when making calls to the Orchestrator
The NMS requires some basic certificate-based authentication when making calls to the Orchestrator
API. To support this, we need to add the relevant certificate as an admin user to the controller.

```bash
Expand All @@ -41,70 +42,76 @@ juju run-action orc8r-orchestrator/0 create-orchestrator-admin-user

### Create NMS admin user

Create an admin user for the master organization on the NMS. Here specify an email and password that
Create an admin user for the master organization on the NMS. Here specify an email and password that
you will want to use when connecting to NMS as an admin.

```bash
juju run-action nms-magmalte/0 create-nms-admin-user email=<your email> password=<your password>
```

### Change log verbosity

You can set the log level of any service using the `set-log-verbosity` action. The default log
level is 0 and the full log level is 10. Here is an example of setting the log level to 10 for the
level is 0 and the full log level is 10. Here is an example of setting the log level to 10 for the
`obsidian` service:

```bash
juju run-action orc8r-orchestrator/0 set-log-verbosity level=10 service=obsidian
```


## DNS Resolution
Some services will have to be exposed to outside of the Kubernetes cluster. This is done by
associating LoadBalancer addresses to resolvable domains. Here is the association of Kubernetes
service to record that you will have to implement:

Some services will have to be exposed to outside of the Kubernetes cluster. This is done by
associating LoadBalancer addresses to resolvable domains. Here is the association of Kubernetes
service to record that you will have to implement:

| Kubernetes service | Record name |
|:-------------------------|:----------------------------------------|
| Kubernetes service | Record name |
| :----------------------- | :-------------------------------------- |
| `nginx-proxy` | `*.nms.<your domain>` |
| `orc8r-bootstrap-nginx` | `bootstrapper-controller.<your domain>` |
| `orc8r-clientcert-nginx` | `controller.<your domain>` |
| `orc8r-nginx-proxy` | `api.<your domain>` |
| `orc8r-nginx-proxy` | `api.<your domain>` |

For more details, please refer to the documentation provided for your specific
For more details, please refer to the documentation provided for your specific
cloud provider.


## Verify the Deployment
### NMS
You can confirm successful deployment by visiting the master NMS organization at e.g.
`https://master.nms.<your domain>` and logging in with your email and password provided above

### NMS

You can confirm successful deployment by visiting the master NMS organization at e.g.
`https://master.nms.<your domain>` and logging in with your email and password provided above
(`<your email>` and `<your password>` in this example).
If you self-signed certs above, the browser will rightfully complain.
Either ignore the browser warnings at your own risk (some versions of Chrome won't
If you self-signed certs above, the browser will rightfully complain.
Either ignore the browser warnings at your own risk (some versions of Chrome won't
allow this at all), or e.g. import the root CA from above on a per-browser basis.

### Orchestrator
For interacting with the Orchestrator REST API, a good starting point is the Swagger UI available

For interacting with the Orchestrator REST API, a good starting point is the Swagger UI available
at `https://api.<your domain>/swagger/v1/ui/`.

### Juju

You can run `juju status` and you should see all charms are in the `Active-Idle`status.

### Kubernetes
You can run `kubectl get pods -n <your model>` and you should see that all pods are up and

You can run `kubectl get pods -n <your model>` and you should see that all pods are up and
running.

## Debug

Logs can be found by querying each individual pod. Example:

```bash
kubectl logs nms-magmalte-0 -c magma-nms-magmalte -n <your model> --follow
```


## Detailed content

Orchestrator is made up of multiple services and this bundle contains a charm per service:

- [magma-nms-magmalte](https://charmhub.io/magma-nms-magmalte)
- [magma-nms-nginx-proxy](https://charmhub.io/magma-nms-nginx-proxy)
- [magma-orc8r-accessd](https://charmhub.io/magma-orc8r-accessd)
Expand Down Expand Up @@ -133,6 +140,7 @@ Orchestrator is made up of multiple services and this bundle contains a charm pe
- [magma-orc8r-tenants](https://charmhub.io/magma-orc8r-tenants)

## References

- [Juju](https://juju.is/docs)
- [Magma](https://docs.magmacore.org/docs/basics/introduction.html)
- [Orchestrator](https://docs.magmacore.org/docs/orc8r/architecture_overview)
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-certifier-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _create_secrets(self) -> bool:
return True

def _delete_secrets(self) -> None:
"""Delete Kubernetes secrets created by the create_secrets method"""
"""Delete Kubernetes secrets created by the create_secrets method."""
client = Client()
for secret in self._magma_orc8r_certifier_secrets:
client.delete(SecretRes, name=secret, namespace=self._namespace)
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-dispatcher-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class MagmaOrc8rDispatcherCharm(CharmBase):
def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-eventd-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class MagmaOrc8rEventdCharm(CharmBase):
def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-ha-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class MagmaOrc8rHACharm(CharmBase):
def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-lte-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MagmaOrc8rLteCharm(CharmBase):

BASE_CONFIG_PATH = "/var/opt/magma/configs/orc8r"

# TODO: The various URL's should be provided through relationships.
# TODO: The various URL's should be provided through relationships
PROMETHEUS_URL = "http://orc8r-prometheus:9090"
PROMETHEUS_CONFIGURER_URL = "http://orc8r-prometheus:9100"
ALERTMANAGER_URL = "http://orc8r-alertmanager:9093"
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-metricsd-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MagmaOrc8rMetricsdCharm(CharmBase):

def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@


def test_placeholder():
# TODO: write tests
pass
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MagmaOrc8rOrchestratorCharm(CharmBase):

BASE_CONFIG_PATH = "/var/opt/magma/configs/orc8r"

# TODO: The various URL's should be provided through relationships.
# TODO: The various URL's should be provided through relationships
PROMETHEUS_URL = "http://orc8r-prometheus:9090"
PROMETHEUS_CONFIGURER_URL = "http://orc8r-prometheus:9100"
PROMETHEUS_CACHE_GRPC_URL = "orc8r-prometheus-cache:9092"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class MagmaOrc8rServiceRegistry(CharmBase):
def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down
2 changes: 1 addition & 1 deletion orchestrator-bundle/orc8r-streamer-operator/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class MagmaOrc8rStreamer(CharmBase):
def __init__(self, *args):
"""
An instance of this object everytime an event occurs
An instance of this object everytime an event occurs.
"""
super().__init__(*args)
self._service_patcher = KubernetesServicePatch(
Expand Down

0 comments on commit 027df7c

Please sign in to comment.