Commit ffaeb410 authored by George Papathanail's avatar George Papathanail
Browse files

docs(helm): document the 2.0 charts

parent 99002f86
Loading
Loading
Loading
Loading
+140 −37
Changes for README.md: 140 added lines, 37 removed lines.
Original line number Diff line number Diff line
@@ -9,17 +9,30 @@ Intended for local development, integration testing, and demos. **Not for produc

| Component | Namespace | Description |
|---|---|---|
| SRM (Service Resource Manager) | `oop` | Manages application artefacts and lifecycle |
| Artifact Manager | `oop` | Stores and serves artefacts |
| OEG (Open Exposure Gateway) | `oop` | Northbound API entry point for tenants |
| Federation Manager | `oop` | Inter-operator federation workflows |
| OEG (Open Exposure Gateway) | `oop` | Northbound API entry point for app providers (CAMARA APIs) |
| SRM (Service Resource Manager) | `oop` | Orchestrates services on edge clusters and networks through tf-sdk control paths |
| Federation Manager | `oop` | Inter-operator federation (GSMA OPG.04 E/WBI) |
| Keycloak | `oop` | OAuth2/OIDC identity provider: realm `oop` (portal users, app providers, OEG tokens) and realm `federation` (FM partners) |
| PostgreSQL | `oop` | Shared instance; one database and role per component |
| NATS | `oop` | Message bus between OEG, SRM and FM (core NATS, no JetStream) |
| AI2 MCP | `oop` | MCP server exposing CAMARA-compliant tools |
| AI2 AI Agent | `oop` | Natural language interface backed by Groq |
| Portal | `oop` | Developer portal: web UI and its backend (login, OEG and AI2 proxy, API clients) |
| Data Lab | `oop` | Dataspace metadata catalogue: piveau hub and search, Virtuoso, Elasticsearch, the Data Lab UI and API. Off by default, see [Data Lab](#data-lab) |

Each of OEG, SRM and Federation Manager has its own chart README with all its values:
[OEG](oop-platform-chart/charts/oeg/README.md), [SRM](oop-platform-chart/charts/srm/README.md),
[Federation Manager](oop-platform-chart/charts/federation-manager/README.md).

### Architecture

App providers use the Portal or call OEG directly. **OEG** checks their Keycloak token and hands
the work to **SRM**, which deploys applications and drives the network through its tf-sdk
adapters. When a request involves another operator, OEG or SRM asks **Federation Manager**, which
talks to the partner's platform. OEG, SRM and FM also send each other events over **NATS**. OEG,
SRM, FM, Keycloak and the Portal each keep their data in their own database on the shared
**PostgreSQL**. AI2's MCP server calls OEG too.

---

## Prerequisites
@@ -61,12 +74,42 @@ Read a generated value back with, for example:
kubectl -n oop get secret postgres-credentials -o jsonpath='{.data.postgres-password}' | base64 -d
```

### Encryption keys (OEG and Federation Manager)

OEG and Federation Manager each encrypt secrets they store in their database, with a key the
chart generates on first install and keeps across upgrades and `helm uninstall`:

| Component | Secret → key | Encrypts |
|---|---|---|
| OEG | `oegcontroller-keys` → `callback-secret-key` | Webhook credentials app providers give OEG |
| Federation Manager | `federation-manager-keys` → `partner-secret-key` | Partner client secrets entered through FM's API |

**Back them up together with the database, and never change them**: data encrypted with the old
key can't be read with a new one. To read one:

```bash
kubectl -n oop get secret oegcontroller-keys -o jsonpath='{.data.callback-secret-key}' | base64 -d; echo
kubectl -n oop get secret federation-manager-keys -o jsonpath='{.data.partner-secret-key}' | base64 -d; echo
```

To use a key you already have, see "Using your own key Secret" in the
[OEG](oop-platform-chart/charts/oeg/README.md#using-your-own-key-secret) and
[Federation Manager](oop-platform-chart/charts/federation-manager/README.md#partner-secret-key) READMEs.

---

## PostgreSQL

A single shared instance (`charts/postgresql`) with one database and role per component. Not a replacement for a managed database or an operator such as CloudNativePG.

| Database / role | Used by | Password in `postgres-credentials` |
|---|---|---|
| `keycloak` | Keycloak | `keycloak-password` |
| `portal` | Portal | `portal-password` |
| `oeg` | OEG | `oeg-password` |
| `srm` | SRM | `srm-password` |
| `fm` | Federation Manager | `fm-password` |

Pick the volume size and storage class (`postgresql.persistence`) before the first install: they
come from a StatefulSet claim template, which Kubernetes does not change in place.

@@ -96,8 +139,8 @@ Keycloak (`charts/keycloak`) runs as a platform service in `oop`, backed by the
  through the portal; the portal checks `platform-admin` on its user pages.
- Keycloak's public URL is `http://<global.publicHost>:30081` (kind sets `publicHost: localhost`; other
  clusters detect it at install). Every token carries `iss=<public URL>/realms/<realm>`, even when a pod
  fetches it from `http://keycloak:8080`. Services only know the in-cluster URL: they read the issuer
  from Keycloak's discovery document and fetch signing keys there, so no public URL is configured in them.
  fetches it from `http://keycloak:8080`. OEG and Federation Manager expect that public issuer, built
  from the same `global.*` values, but fetch Keycloak's signing keys from the in-cluster URL.
- Tokens from `oop-portal` carry `aud: oeg` and, when the user has one, an `organization` claim.
- **Tenancy.** The user attribute `organization` is the tenant OEG scopes data by; a user without one
  is a tenant of their own (`sub`). Only administrators see or set it (lowercase letters, digits and
@@ -197,22 +240,26 @@ The scripts can also be run individually from any directory.

**`scripts/kind-bootstrap.sh`** (run once per cluster):
1. Checks prerequisites
2. Creates host storage directories at `/tmp/kind-oop/`
3. Creates the `oop-cluster` kind cluster from `environments/kind/cluster.yaml`
4. Creates namespaces (`oop`, `federation-manager`), a `oop-user` service account, and a `cluster-admin` binding
2. Creates the `oop-cluster` kind cluster from `environments/kind/cluster.yaml`
3. Waits for the node and creates the `oop` namespace

**`scripts/helm-deploy.sh`** (re-runnable):
1. Generates a short-lived token for `oop-user`
2. `helm upgrade --install oop-platform ./oop-platform-chart -n oop -f environments/kind/values.yaml`
3. `helm upgrade --install federation-manager ./oop-platform-chart/charts/federation-manager -n federation-manager -f environments/kind/values.fm.yaml`
1. Loads `environments/kind/secrets.values.yaml` if it exists
2. Updates the chart dependencies (downloads the NATS chart)
3. `helm upgrade --install oop-platform ./oop-platform-chart -n oop -f environments/kind/values.yaml`
4. Prints the [access URLs](#access-urls-after-deployment)

On kind, SRM gets a ready-made setup from `environments/kind/values.yaml`: one Kubernetes control
path `k8s-local` that deploys into namespace `oop-apps` of the kind cluster itself, and a matching
bootstrap topology with one zone.

---

## Install on another cluster

No values are required: passwords and client secrets are generated, and the public address is
detected at install time from the first node (its ExternalIP, else its InternalIP). If that is not
the address users reach, pass it once:
No values are required: passwords, client secrets and encryption keys are generated, and the public
address is detected at install time from the first node (its ExternalIP, else its InternalIP). If
that is not the address users reach, pass it once:

```bash
helm upgrade --install oop-platform ./oop-platform-chart -n oop --create-namespace \
@@ -220,49 +267,98 @@ helm upgrade --install oop-platform ./oop-platform-chart -n oop --create-namespa
```

Keycloak is then at `http://<publicHost>:30081`, and the portal's login redirects go to
`http://<publicHost>:30082`. Services inside the cluster only use `http://keycloak:8080` and read
the issuer from Keycloak's discovery document, so nothing else needs the address.
`http://<publicHost>:30082`. OEG and Federation Manager expect tokens issued by that public URL, so
the same `global.publicHost` covers them; they fetch signing keys from `http://keycloak:8080`.

- Detection reads the cluster, so it only works with `helm upgrade --install`; with `helm template` or
  GitOps tools such as Argo CD, set `global.publicHost`.
- Changing the address later does not update the redirect URLs already stored in the `oop` realm
  (realm import only runs for a new realm); update the `oop-portal` client in the admin console.
- `scripts/helm-deploy.sh` also passes SRM a token for the cluster's API, which a bare `helm` command
  does not.
- Only Keycloak and the Portal get NodePorts by default. To reach OEG, SRM or Federation Manager from
  outside, set their `service.type` and `service.nodePort` (as `environments/kind/values.yaml` does).
- SRM has no control paths or topology by default, so it can't deploy anything until you set
  `srm.srmcontroller.controlPaths`, `topology` and `workloads.namespaces`; see the
  [SRM README](oop-platform-chart/charts/srm/README.md).
- Federation partners must reach FM's callback links: set
  `federation-manager.federationManager.publicUrl`; see the
  [Federation Manager README](oop-platform-chart/charts/federation-manager/README.md#callback-links).

---

## Access URLs (after deployment)

On kind, as printed by `scripts/helm-deploy.sh`:

| Service | URL |
|---|---|
| SRM Dashboard | http://localhost:32415 |
| Artifact Manager | http://localhost:30080 |
| OEG API (Swagger) | http://localhost:32263/oeg/1.0.0/docs/ |
| SRM API | http://localhost:32415 |
| OEG API (Swagger) | http://localhost:32263/docs |
| Keycloak | http://localhost:30081 |
| Keycloak Admin | http://localhost:30081/admin — user `admin`, password in Secret `keycloak-credentials` (see [Identity](#identity-keycloak)) |
| OIDC discovery (realm `oop`) | http://localhost:30081/realms/oop/.well-known/openid-configuration |
| Federation Manager | http://localhost:30989 |
| AI2 MCP | http://localhost:32004 |
| AI2 AI Agent | http://localhost:32013 |
| Portal | http://localhost:30082 |
| Data Lab (when enabled) | http://localhost:30083 |

Inside the cluster: `http://oeg`, `http://srm:8080`, `http://federation-manager:8082`,
`http://keycloak:8080`, `nats://oop-nats:4222`, `postgres:5432`.

---

## Upgrade

Re-run `scripts/helm-deploy.sh`, or:

```bash
# Upgrade core platform (SRM + OEG)
helm upgrade oop-platform ./oop-platform-chart \
  -n oop \
  -f environments/kind/values.yaml \
  --set srm.srmcontroller.env.kubernetesMasterToken="$(kubectl -n oop create token oop-user)"

# Upgrade Federation Manager
helm upgrade federation-manager ./oop-platform-chart/charts/federation-manager \
  -n federation-manager \
  -f environments/kind/values.fm.yaml
helm upgrade oop-platform ./oop-platform-chart -n oop -f environments/kind/values.yaml
```

Generated passwords, client secrets and encryption keys are read back from their Secrets and kept.

---

## Upgrading from 1.x

Upgrading a 1.x installation in place is **not supported**. 1.x kept OEG, SRM and Federation
Manager data in MongoDB; 2.0 uses PostgreSQL, and the old data is **not migrated**. Install 2.0
fresh:

1. Save anything you still need from the 1.x MongoDB databases.
2. Uninstall the 1.x release:

   ```bash
   helm uninstall oop-platform -n oop
   ```

3. Check that no MongoDB volume or claim is left (the 1.x charts created them, so `helm uninstall`
   normally deletes them; the data itself stays in the volumes' host directories), and delete any
   that remain:

   ```bash
   kubectl get pvc -n oop
   kubectl delete pvc -n oop <each MongoDB claim>
   kubectl get pv
   kubectl delete pv <each MongoDB volume>
   ```

4. If the 1.x bootstrap script ran on this cluster, delete the ServiceAccount it created for SRM's
   token and its cluster-admin binding; 2.0 no longer uses them:

   ```bash
   kubectl delete clusterrolebinding oop-user-binding
   kubectl -n oop delete serviceaccount oop-user
   ```

5. Install 2.0 as described above.

On kind it's simpler to start over, since `environments/kind/cluster.yaml` changed too (no MongoDB
mounts, no Artifact Manager port):

```bash
kind delete cluster --name oop-cluster
sudo rm -rf /tmp/kind-oop        # 1.x MongoDB data on the host
./deploy-on-kind.sh
```

---
@@ -271,10 +367,18 @@ helm upgrade federation-manager ./oop-platform-chart/charts/federation-manager \

```bash
helm uninstall oop-platform -n oop
helm uninstall federation-manager -n federation-manager
kind delete cluster --name oop-cluster
```

`helm uninstall` keeps some things on purpose, so a reinstall finds them again: the PostgreSQL
volume, the Secrets `postgres-credentials`, `keycloak-credentials`, `portal-credentials`,
`oegcontroller-keys` and `federation-manager-keys`, and SRM's workload namespaces (e.g. `oop-apps`).
To remove everything on a cluster you keep, also delete those, or the namespaces:

```bash
kubectl delete namespace oop oop-apps
```

---

## Configuration files
@@ -282,9 +386,9 @@ kind delete cluster --name oop-cluster
| File | Purpose |
|---|---|
| `oop-platform-chart/values.yaml` | Base defaults for all components |
| `environments/kind/values.yaml` | kind overrides (NodePorts, hostPath, storageClass, pullPolicy) |
| `environments/kind/values.yaml` | kind overrides (NodePorts, `publicHost: localhost`, SRM control path and topology, sample users) |
| `environments/kind/secrets.values.yaml` | **Gitignored.** Per-environment secrets (see [Secrets](#secrets)) |
| `environments/kind/cluster.yaml` | kind cluster definition (port mappings, host mounts) |
| `environments/kind/cluster.yaml` | kind cluster definition (port mappings) |

---

@@ -292,7 +396,6 @@ kind delete cluster --name oop-cluster

```bash
kubectl get pods -n oop
kubectl get pods -n federation-manager

# Inspect a failing pod
kubectl describe pod <pod-name> -n oop
+166 −297

File changed.

Preview size limit exceeded, changes collapsed.

+147 −278

File changed.

Preview size limit exceeded, changes collapsed.

+163 −158

File changed.

Preview size limit exceeded, changes collapsed.