Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ NODE_ENV=development

# EdgeOps Console static embed (npm run build:console → dev/console/build)
EDGEOPS_CONSOLE_PATH=dev/console/build # must be absolute path
EDGEOPS_CONSOLE_VERSION=v1.1.3
EDGEOPS_CONSOLE_VERSION=v1.1.4
# EDGEOPS_CONSOLE_REPO=https://github.com/Datasance/edgeops-console
# EDGEOPS_CONSOLE_FLAVOR=datasance

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/set-build-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
shell: bash
run: |
VERSION="${{ env.EDGEOPS_CONSOLE_VERSION }}"
if [ -z "$VERSION" ]; then VERSION="1.1.3"; fi
if [ -z "$VERSION" ]; then VERSION="1.1.4"; fi
echo "EDGEOPS_CONSOLE_VERSION=$VERSION" >> "${GITHUB_ENV}"

REPO="${{ env.EDGEOPS_CONSOLE_REPO }}"
Expand Down
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Changelog

## [Unreleased]

### Added

- **NATS topology `jsDomain`** — each NATS node on `/api/v3/network-topology/nats/nodes`, the NATS overview, the subgraph, and node detail includes `jsDomain`. A hub or server reports the Controller namespace. A leaf reports the agent name, or `null` when the agent row is missing.

### Fixed

- **NATS operator rotation on Kubernetes** — resolver reconciliation writes the new operator JWT into `iofog-nats-config` when that line differs. The NATS image reloads `server.conf`. The `nats` StatefulSet is not rolled for this change.

### Changed

- **Service `defaultBridge`** — a `microservice` or `agent` service accepts the agent name or the agent uuid of an interior that agent's router can reach. Uuid is matched first, then the agent name. The stored value is that agent's uuid. `default-router` stays the literal hub id. Reachability walks the interior mesh in both directions, so a bridge behind another interior is accepted and a bridge in another island is rejected. On Kubernetes, `k8sType`, `servicePort`, and the cluster Service are used only for `default-router`. A named bridge stores the listener on that router and sets `serviceEndpoint` to its host.
- **NATS leaf solicit list** — a leaf keeps one remote per application account. Every named upstream is a URL on that remote, dialed one at a time. Naming several servers in the same cluster no longer opens a connection per server.
- **Leaf upstreams** — omitted on create attaches to `default-nats-hub` only. `[]` attaches to nothing. A later update that omits the field still keeps the stored list. A list is either servers or leaves. A mix, a cycle, or two leaf parents that do not share the same next hop is rejected. A leaf may attach to a leaf that itself has no upstream.
- **Leaf listener** — a leaf listens for child leaves on the leafnode port, with TLS and advertise set to the agent host. A changed leaf broker config is written to the ConfigMap. The leaf container is not rebuilt.
- **Server cluster** — `upstreamNatsServers` on a server is not used and is not stored. Every server is connected to every other server, and cluster routes are that mesh. On Kubernetes, `iofog-nats-config` is patched when that route list changes, including a server that becomes a leaf. The `nats` StatefulSet rolls when the list gains its first route or loses a route. Adding a route to a cluster that already has routes does not roll it.
- **Parent leaf accounts** — a leaf's resolver, upward remotes, and leaf credentials include the application accounts of the leaves below it. Changing a leaf's upstream list refreshes every leaf above the parents that were added or removed. Turning an application's NATS access on or off, deleting the application, or creating, deleting, or moving one of its microservices, refreshes that agent, every leaf above it, and the servers.
- **`@google-cloud/secret-manager` ^6.1.1 → ^7.2.0** — drop production `glob` 10.5.0 and nested `minimatch` 9.0.9 pulled in through `google-gax` 5 and `rimraf` 5 (GHSA-3g3m-2fjr-6pw4, GHSA-g3hv-75wg-m249). Secret Manager client calls are unchanged. The same advisories remain on dev-only `mocha`, `nyc`, and `sequelize-cli`. `better-npm-audit audit -p` is clean.
- Dockerfile base image digest pins refreshed for **`node:24-bookworm`** (console-builder and builder) and **`ubi9/nodejs-24-minimal`**.
- Embedded **EdgeOps Console** default **v1.1.3 → v1.1.4**

### Unchanged

- JetStream domains stay the Controller namespace on a server and the agent name on a leaf.

## [v3.9.4]

### Added
Expand All @@ -13,7 +39,7 @@

### Changed

- Embedded **EdgeOps Console** default **v1.1.1 → v1.1.2**
- Embedded **EdgeOps Console** default **v1.1.2 → v1.1.3**
- Dockerfile runtime base image digest pin refreshed for **`ubi9/nodejs-24-minimal`**.
- **`node-forge` ^1.4.0 → ^1.4.2** — address CVE-2026-85393 (GHSA-86w9-cpqp-85rv, PKCS#1 v1.5 signature verification) and the PEM and ASN.1 denial-of-service fixes in 1.4.1. Certificate generation and PEM parsing are unchanged.
- **`qs` 6.16.0 → 6.16.1**, including the `qs` override — address GHSA-6pq8-jhm2-2vcw (`stringify` with `arrayFormat: 'comma'` throws on a non-callable `toString`).
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# ioFog overrides: EDGEOPS_CONSOLE_REPO=https://github.com/eclipse-iofog/edgeops-console
# EDGEOPS_CONSOLE_FLAVOR=iofog
# node:24-bookworm — pin manifest list digest for reproducible multi-arch builds
FROM node:24-bookworm@sha256:d862bb5d082c5ae0210ac07e8c0344cb8cf7bef6d78e9b8c50c179da923108ea AS console-builder
FROM node:24-bookworm@sha256:8fa96264f302f58bbb13aa7339c541547b56975766ce956c875da149452a3e40 AS console-builder

ARG EDGEOPS_CONSOLE_REPO=https://github.com/Datasance/edgeops-console
ARG EDGEOPS_CONSOLE_VERSION=v1.1.3
ARG EDGEOPS_CONSOLE_VERSION=v1.1.4
ARG EDGEOPS_CONSOLE_FLAVOR=datasance

RUN apt-get update \
Expand All @@ -28,7 +28,7 @@ RUN test -f build/index.html \
&& cp -a build /tmp/console/build


FROM node:24-bookworm@sha256:d862bb5d082c5ae0210ac07e8c0344cb8cf7bef6d78e9b8c50c179da923108ea AS builder
FROM node:24-bookworm@sha256:8fa96264f302f58bbb13aa7339c541547b56975766ce956c875da149452a3e40 AS builder

ARG PKG_VERSION

Expand All @@ -48,9 +48,9 @@ RUN npm pack


# ubi9/nodejs-24-minimal:latest — pin manifest list digest for reproducible multi-arch builds
FROM registry.access.redhat.com/ubi9/nodejs-24-minimal@sha256:18afd48c9af3c1f3df52cf72d1d0ea5bd3f07c50e4731ffd56b5b46bf4bb6639
FROM registry.access.redhat.com/ubi9/nodejs-24-minimal@sha256:da724df0db4baceb0b89ebdc160dfe330fe3b215925742ee9e65efdfc6038850

ARG EDGEOPS_CONSOLE_VERSION=v1.1.3
ARG EDGEOPS_CONSOLE_VERSION=v1.1.4
ARG IMAGE_REGISTRY
ARG OCI_SOURCE_REPO
ARG CONTROLLER_DISTRIBUTION=iofog
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Local Docker build — mirrors CI/release build-args (see .github/actions/set-build-env).
# Override any variable: make build FLAVOR=iofog EDGEOPS_CONSOLE_VERSION=v1.1.3
# Override any variable: make build FLAVOR=iofog EDGEOPS_CONSOLE_VERSION=v1.1.4

FLAVOR ?= datasance
IMAGE_NAME ?= controller
Expand All @@ -25,7 +25,7 @@ else
$(error FLAVOR must be "datasance" or "iofog", got "$(FLAVOR)")
endif

EDGEOPS_CONSOLE_VERSION ?= v1.1.3
EDGEOPS_CONSOLE_VERSION ?= v1.1.4

IMAGE_REF = $(IMAGE_REGISTRY)/$(IMAGE_NAME):$(DOCKER_TAG)

Expand Down
2 changes: 2 additions & 0 deletions docs/networking-topology-controlplane.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ The operator owns the hub processes and the listener, TLS, and replica-route sec

**`iofog-nats-config` / `server.conf`.** When an agent NATS server is ensured or removed, Controller rewrites the `routes` array. Every route that contains `nats-headless` is kept. Routes for agent servers (`nats://{agentHost}:{clusterPort}`) are appended. The operator’s next rewrite replaces its own `nats-<i>.nats-headless` ordinals and keeps those non-ordinal routes. Removing an agent server also rolls the `nats` StatefulSet so the pods drop the deleted route. Adding a server patches the ConfigMap and does not roll the StatefulSet by itself.

The same reconcile replaces the `operator` line when it differs from the current operator JWT. That write does not roll the StatefulSet. The NATS image reloads `server.conf`. The installer’s rewrite of this file must take `operator` from `GET /api/v3/nats/operator`, not from the JWT stored at bootstrap, and must not restart the StatefulSet for that line. When the operator public key changes, refresh secret `nats-operator-seed` from `GET /api/v3/nats/bootstrap`.

**`iofog-nats-jwt-bundle`.** When application accounts change, Controller patches this ConfigMap with the full resolver bundle: the system account, every application with `natsAccess`, and the controller relay account when NATS relay is enabled. The patch runs only when the bundle contents change. Because the operator does not replace an existing ConfigMap, those extra account JWTs survive the operator’s next reconcile. User credential files are not in this bundle. How those accounts are signed is in [nats-access.md](nats-access.md).

No agent on this control plane is `isSystem`, and none of them is the hub. A leaf still dials the hub host stored by `PUT /api/v3/nats/hub`. An edge router still dials the host stored by `PUT /api/v3/router`.
Expand Down
47 changes: 33 additions & 14 deletions docs/networking-topology-messaging-fabric.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@ natsMode: leaf

| Role | What it is | What the process listens on |
|---|---|---|
| `leaf` | Local NATS that dials upstream servers over TLS | Client `4222`, MQTT `8883`, monitor `8222` |
| `server` | Full server. Forms the cluster and accepts leaf connections. | Those, plus cluster `6222` and leafnode `7422` |
| `leaf` | Local NATS. One upstream connection per application account. | Client `4222`, MQTT `8883`, monitor `8222`, and leafnode `7422` |
| `server` | Full server. One cluster with every other server, and it accepts leaf connections. | Those, plus cluster `6222` |
| `none` | No NATS process on this agent | None |

Both `leaf` and `server` publish the full port set on the microservice (`4222`, `6222`, `7422`, `8883`, `8222`). A leaf does not open the cluster or leafnode listeners. It dials each upstream on `7422`.
Both `leaf` and `server` publish the full port set on the microservice (`4222`, `6222`, `7422`, `8883`, `8222`). A leaf does not open the cluster listener. It listens on the leafnode port and dials each named upstream on `7422`.

`host` is required unless both the router role and the NATS role are `none`.

Omit `upstreamNatsServers` and Controller attaches this node to the hub (`default-nats-hub`) plus every NATS server that runs on a system agent. A leaf cannot be an upstream. Name an upstream by agent uuid, agent name, or `default-nats-hub`.
`upstreamNatsServers` names an agent uuid, an agent name, or `default-nats-hub`.

On a server that list is not used and is not stored. Every server is connected to every other server, in both directions, and a server is not connected to itself. Cluster routes are those other servers. Naming a leaf in the list is not an error. A later read shows the other servers, not the list that was submitted.

On a leaf the list is the solicit list for one connection per application account. Omit it on create and the leaf attaches to `default-nats-hub` only. After that dial succeeds, leafnode advertise tells the leaf about the other servers. If the hub is down on the first dial, the leaf does not try those other servers unless you named them. Send `[]` and the leaf stores no upstream. Workloads on that node use the local broker only. A later update that omits the field keeps the stored list, including an empty one. Sending the key replaces the list.

A leaf list is all servers or all leaves. Controller rejects a mix of a server and a leaf, a name that is this same node, a cycle, a named leaf that is already upstream of another named leaf, and two leaf parents whose next hops differ. Two leaf parents are accepted when neither is upstream of the other and both have the same upstream destinations, including when both have none. A leaf may name a parent leaf that itself has no upstream. That tree does not gain a connection to the hub.

A system agent must be `natsMode: server`. On a control plane that is not Kubernetes, the first agent in an empty cluster is the system agent. Controller sets `routerMode: interior` and `natsMode: server` on that create, including when the request asked for another role. That node becomes the hub when no hub exists yet.

Expand Down Expand Up @@ -80,8 +86,8 @@ What is protected:
|---|---|
| Client port `4222` | Operator mode. Clients authenticate with a user JWT. The generated config does not put a TLS stanza on this port. Workload creds are issued automatically. See [nats-access.md](nats-access.md). |
| Cluster (servers) | TLS, `verify: true`, `handshake_first: true` |
| Leafnode listener (servers) | TLS, `verify: true`, `handshake_first: true` |
| Leaf remotes (leaves) | TLS, `verify: true`, `handshake_first: true`. Each URL is `tls://{upstreamHost}:{leafPort}`. |
| Leafnode listener | TLS, `verify: true`, `handshake_first: true`. Servers and leaves both listen. Advertise is the agent host. |
| Leaf remotes | TLS, `verify: true`, `handshake_first: true`. Each address is `tls://{upstreamHost}:{leafPort}`, and every address for one account sits on one remote. |
| MQTT `8883` | TLS, `handshake_first: true` |
| JetStream disk | ChaChaPoly with a per-node key Controller generates |

Expand All @@ -106,7 +112,7 @@ jetstream: {

cluster: {
port: 6222
routes: ["nats://<each server host>:6222"]
routes: ["nats://<each other server host>:6222"]
tls: { verify: true, handshake_first: true, ca/cert/key from nats-server-<name> }
}

Expand All @@ -132,17 +138,30 @@ The resolver directory is the account-JWT bundle: the system account, every appl

A server also gets a system user (`admin-hub` on the hub, `admin-server-{agent}` on other servers) and mounts that creds file at `/etc/nats/creds`.

When another server is added or removed, Controller recomputes cluster routes for every server and reconciles the others. Growing the cluster from one member to many rebuilds the local NATS container so it switches to the clustered config. On Kubernetes, routes that contain `nats-headless` are left in place and the agent servers are appended.
`upstreamNatsServers` on a server does not choose peers. Controller stores one connection each way between every pair of servers and none from a server to itself. Cluster `routes` are the other servers' `nats://host:6222` values, taken from that mesh. A peer with no host is skipped. A server with no peers renders the no-cluster template, which has no `cluster` block and no route to itself.

When a server is added or removed, Controller repairs that mesh and reconciles the other servers. Growing the cluster from one member to many rebuilds the local NATS container so it switches to the clustered config. On Kubernetes, routes that contain `nats-headless` are left in place and the agent servers are appended.

---

## Leaf config and connections

`natsMode: leaf` renders `leaf.conf`. It still runs JetStream, MQTT, the operator, and a resolver. It does not open cluster routes. It dials upstreams:
`natsMode: leaf` renders `leaf.conf`. It still runs JetStream, MQTT, the operator, and a resolver. It does not open cluster routes. It listens for child leaves on the leafnode port, with TLS and advertise set to the agent host:

```
leafnodes: {
port: 7422
advertise: <agent host>
tls: { verify: true, handshake_first: true, certificate nats-server-<name> }
remotes: [ ... ]
}
```

Each application account is one remote. `urls` is the solicit list: one `tls://{host}:{leafPort}` address per accepted upstream, in the order given, with a repeated name kept once. The leaf dials one address. If that host is down before the first successful dial, it tries the next. It does not hold a connection per address.

```json
{
"urls": ["tls://203.0.113.1:7422"],
"urls": ["tls://203.0.113.1:7422", "tls://203.0.113.2:7422"],
"account": "<application account public key>",
"credentials": "/etc/nats/creds/orders/leaf-plant-a.creds",
"tls": {
Expand All @@ -156,13 +175,13 @@ When another server is added or removed, Controller recomputes cluster routes fo
}
```

Controller creates that remote for each application that has `natsAccess` and a microservice on this agent, and for each upstream server. The leaf user is `leaf-{agentName}` inside that application account, with the `default-leaf-user` rule (`LEAFNODE` and `WEBSOCKET`). The creds files are collected into ConfigMap `nats-leaf-creds-{agent}` and mounted at `/etc/nats/creds`.
Controller creates that remote for each non-system application that has `natsAccess` and a microservice on this agent, and for the same kind of application on every leaf below this one. The leaf user is `leaf-{agentName}` inside that application account, with the `default-leaf-user` rule (`LEAFNODE` and `WEBSOCKET`), including when the application has no workload on this agent. A child's `SYS-leaf-*` account stays on the child. The creds files are collected into ConfigMap `nats-leaf-creds-{agent}` and mounted at `/etc/nats/creds`.

The leaf resolver bundle is smaller than the hub bundle. It holds this fog's leaf system account (`SYS-leaf-{agentName}`) and the application accounts that have workloads here. It is ConfigMap `nats-jwt-bundle-{agent}`.
The leaf resolver bundle holds this fog's leaf system account (`SYS-leaf-{agentName}`) and those application accounts. It is ConfigMap `nats-jwt-bundle-{agent}`. A parent whose own upstream list is empty still stores the downstream account tokens and does not gain a hub remote.

A leaf also has its own system user `admin-leaf-{agent}` on that leaf system account, used for the leaf's system traffic.
The JetStream domain stays the agent name on a leaf and the Controller namespace on a server. A stream on the hub is not automatically present on a factory leaf. `GET /api/v3/network-topology/nats/nodes` returns that domain as `jsDomain` on every NATS node. The NATS overview, subgraph, and node detail use the same field. A hub or server reports the Controller namespace. A leaf reports the agent name, or `null` when the agent row is missing.

If you leave `upstreamNatsServers` empty, the upstream set is the hub plus each system agent's NATS server. A system agent created before a hub exists starts with no upstreams. Later leaves attach to the hub.
Omit `upstreamNatsServers` on create and the leaf solicits `default-nats-hub` only. Other servers are learned from advertise after that dial. A hub that is down on the first dial is not replaced by servers you did not name. `[]` is a local broker. A later update that omits the field keeps the stored list. A system agent created before a hub exists starts with no upstreams. Later leaves attach to the hub.

Switching a leaf to a server removes the leaf JWT ConfigMap, the leaf creds ConfigMap, and the leaf system account. Switching a server to a leaf builds those artifacts and stops using cluster routes.

Expand Down
2 changes: 1 addition & 1 deletion docs/pki.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ POST /api/v3/nats/operator/rotate
Authorization: Bearer <admin-token>
```

Controller accepts the request, rotates operator material, re-signs accounts, and schedules resolver reconciliation in the background. Plan maintenance when NATS leaf nodes may reload operator trust.
Controller accepts the request, rotates operator material, re-signs accounts, and schedules resolver reconciliation in the background. On Kubernetes that reconcile writes the new operator JWT into `iofog-nats-config`. The NATS image reloads the file. The StatefulSet is not restarted for this change. Agent NATS configs are rendered with the same JWT and reload the same way.

This is **NATS credential rotation**, not the skipped per-agent CA migration.

Expand Down
Loading