> This page is for Remediation Orchestrator.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/remediation-orchestrator/llms.txt.

# Application chart

This chart installs the NVIDIA Remediation Orchestrator (NRO) server as a Deployment
by default, or an opt-in StatefulSet with stable per-replica DNS. The server runs
the API, UI, Temporal worker and indexers. The chart also creates a Service.
Optional resources include Ingress or Gateway API HTTPRoute, Prometheus
ServiceMonitor, PodDisruptionBudget and NetworkPolicies. An optional nginx proxy
serves the Temporal UI under `/temporal`.

It does not install PostgreSQL, Temporal, Dex or an OpenTelemetry collector, and it
generates no credentials. Its only hook is the Helm test. It has no install or upgrade
hooks. Provision those dependencies before you install this chart, then configure it with
the existing Secrets and service addresses. The `0.1.0` chart is experimental. A
successful render of an example does not show that its placeholder endpoints or image
digest work.

If you use Helmfile, follow a [quick start](/remediation-orchestrator/deployment/helm#install-the-stack). Helmfile
can also use [existing backing services](/remediation-orchestrator/deployment/helm/configuration/services#use-existing-backing-services).

If you use plain Helm, install in this order: PostgreSQL and Temporal, the
[bootstrap chart](/remediation-orchestrator/deployment/helm/reference/bootstrap-chart), then this chart after
the bootstrap Jobs complete ([Install with plain Helm](#install-with-plain-helm)). The
bootstrap chart prepares the Temporal namespace and migrates the NRO database schema.
With the [startup-migration alternative](#database-migrations), NRO migrates the schema
itself, so an installation that prepares Temporal another way can omit the bootstrap chart.

The [glossary](/remediation-orchestrator/deployment/helm/reference/stack#glossary) defines terms such as DSN, JWKS and
pgx.

## Contents

- [Requirements](#requirements)
- [Quick start](#quick-start)
- [Important values](#important-values)
- [How the public URL is used](#how-the-public-url-is-used)
- [Authentication modes](#authentication-modes)
- [Temporal UI proxy](#temporal-ui-proxy)
- [Extensions](#extensions)
- [Configuration and scripts](#configuration-and-scripts)
- [Workload identity](#workload-identity)
- [Plain-Helm call-home wiring](#plain-helm-call-home-wiring)
- [Operational notes](#operational-notes)
- [NetworkPolicy](#networkpolicy)
- [Database migrations](#database-migrations)
- [Null overrides](#null-overrides)
- [Endpoints without authentication](#endpoints-without-authentication)
- [Offline validation](#offline-validation)
- [Versions](#versions)

## Requirements

| Requirement | Detail |
| --- | --- |
| Helm | 3.19.4 or later, including Helm 4 (CI tests 3.19.4 and 4.3.0) |
| Kubernetes | 1.21 or later, per `kubeVersion: ">=1.21.0-0"` in `Chart.yaml` |

`Chart.yaml` cannot express a Helm version constraint, so check `helm version` before you
install. The notes that Helm prints after install repeat the supported versions. The
Kubernetes floor comes from the `policy/v1` PodDisruptionBudget. HTTPRoute and
ServiceMonitor are CRDs with their own requirements. The stack's
[support matrix](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/helm/docs/reference/tools.md#support-matrix)
covers the whole stack, which needs a newer cluster.

Helm 4.0.0's `helm template` renders with Kubernetes 1.20 capabilities by default and
rejects the chart's 1.21 floor. Pass `--kube-version 1.21.0` or later to it. The 1.20
capabilities are a rendering default, and the floor stays 1.21.

The TOML syntax that Helm accepts, and its duplicate-key checks, differ between Helm
versions. [Configuration and scripts](#configuration-and-scripts) describes the
differences.

## Quick start

NRO publishes no image. Build one in an application source checkout
([Build the NRO image](/remediation-orchestrator/deployment/images#build-the-nro-image)) or use a compatible
image you already have. Load or push the image, and use the same image for
`remediation-orchestrator-bootstrap`. The image must contain `/bin/maestro`,
`/var/static/dist`, runtime libraries and the `/bin/database-ready` probe that bootstrap
runs with its retry flags. It must also run as UID 10001. To install the whole stack,
with the databases, Temporal, collector, bootstrap and this chart, use the Helmfile
instead. Refer to the [quick starts](/remediation-orchestrator/deployment/helm#install-the-stack).

The chart ships two example values files, plus the call-home overlay
`examples/callhome.yaml` ([Plain-Helm call-home wiring](#plain-helm-call-home-wiring)):

- `examples/local.yaml`: no login (`developmentNone`),
  image `remediation-orchestrator:local` with `pullPolicy: Never`, loaded into a
  kind cluster named `remediation-orchestrator` (the build, tag and
  `kind load docker-image` commands are in the file's header). Use it only on
  isolated development clusters. It reads the database Secret `nro-db-app` and the
  Temporal frontend `nro-temporal-frontend:7233` in the release namespace.
- `examples/secure.yaml`: Dex login, HTTPS `publicUrl`, image by digest, Ingress,
  ServiceMonitor, PodDisruptionBudget and NetworkPolicy. Every endpoint, Secret
  name and the digest are placeholders.
  - Replicas: its `replicaCount: 2` illustrates the disruption budget. It is not a
    high-availability promise. More than one replica needs runtime qualification of
    overlapping workers for your module set. With the default `Recreate` strategy,
    every rollout stops all NRO pods before new ones start, whatever `replicaCount` is.
  - Exposure: its Ingress also exposes the
    [endpoints without authentication](#endpoints-without-authentication), including
    `/metrics`. Decide on edge path rules before you expose it.
  - ServiceMonitor: it needs the Prometheus Operator CRDs, so render it offline with
    `--api-versions monitoring.coreos.com/v1/ServiceMonitor`
    ([Offline validation](#offline-validation)).
  - Prometheus NetworkPolicy peer: its NetworkPolicy admits Prometheus through one peer
    that pairs a `namespaceSelector` for the `monitoring` namespace with a `podSelector`
    for `app.kubernetes.io/name: prometheus`. Change both to match your monitoring
    namespace and Prometheus pod labels, or the scrape is blocked.

### Install with plain Helm

1. Provision PostgreSQL and Temporal, create the Kubernetes namespace, and create the
   Secrets your values reference in it.
2. Install the [bootstrap chart](/remediation-orchestrator/deployment/helm/reference/bootstrap-chart#install)
   in that namespace and wait for its Jobs.
3. Change to this chart's directory, `charts/remediation-orchestrator` under the Helm
   module root. Copy `examples/secure.yaml`, described above, to `my-values.yaml` and
   replace every placeholder.
4. Render the values. The `--api-versions` flag stands in for the ServiceMonitor CRD
   offline, so drop it if you disable the ServiceMonitor. The render changes nothing in
   the cluster. Continue only after it succeeds and you have reviewed its output.

   ```sh
   # Render the chart with your values for review.
   helm template remediation-orchestrator . -f my-values.yaml \
     --namespace remediation-orchestrator --api-versions monitoring.coreos.com/v1/ServiceMonitor
   ```

5. Select the target cluster
   ([Select the cluster](/remediation-orchestrator/deployment/helm/configuration/environments#select-the-cluster)), then install and run
   the Helm test. These commands change the cluster:

   ```sh
   # Make the target cluster the current context.
   kubectl config use-context CONTEXT
   # Clear the override that would send Helm to another cluster.
   unset HELM_KUBECONTEXT
   # Install or upgrade NRO and wait until it is ready.
   helm upgrade --install remediation-orchestrator . \
     --namespace remediation-orchestrator -f my-values.yaml --wait --timeout 15m
   # Run the chart's health test and print its output.
   helm test remediation-orchestrator --namespace remediation-orchestrator --logs
   ```

### Try the example on the local stack

This path needs the local Helmfile stack already running. Follow
[Quick start: Local K8s](/remediation-orchestrator/deployment/helm/quick-start/local-k8s), which creates the kind cluster,
loads the image as `remediation-orchestrator:local`, and installs the dependencies with
the Temporal namespace `default` that `examples/local.yaml` uses.

The `helm upgrade` below replaces the values of the Helmfile-managed
`remediation-orchestrator` release with the example's values. They stay in effect until
a later `helmfile -f ./helmfile -e local sync` from the Helm module root reapplies the
Helmfile's values; Helmfile does not do this on its own. Use these commands only to try
the example.
The Helmfile's pinned context does not change your kubeconfig's current context, so
select the kind cluster first and confirm it
([Select the cluster](/remediation-orchestrator/deployment/helm/configuration/environments#select-the-cluster)). From the Helm module root:

```sh
# Make the kind cluster the current context.
kubectl config use-context kind-remediation-orchestrator
# Clear the override that would send Helm to another cluster.
unset HELM_KUBECONTEXT
# Enter the chart directory.
cd charts/remediation-orchestrator
# Lint the chart with the example values.
helm lint --strict . -f examples/local.yaml
# Render the example for review.
helm template remediation-orchestrator . -f examples/local.yaml --namespace remediation-orchestrator
# Replace the release's values with the example's and wait until NRO is ready.
helm upgrade --install remediation-orchestrator . \
  --namespace remediation-orchestrator -f examples/local.yaml --wait --timeout 15m
# Run the chart's health test and print its output.
helm test remediation-orchestrator --namespace remediation-orchestrator --logs
# Forward the NRO web UI to http://127.0.0.1:6787.
kubectl --namespace remediation-orchestrator \
  port-forward --address 127.0.0.1 service/remediation-orchestrator 6787:6787
```

The example installs only NRO. It uses the databases, Temporal namespace and collector that
the Helmfile provisioned, and rendering it alone does not test those connections. After
`helm test` passes, use the port-forward to check `http://127.0.0.1:6787/status` from the
host as well.

## Important values

The generated resource name must start with a lowercase letter for Kubernetes
Services. If your release name starts with a digit, set `fullnameOverride` to a
name such as `nro-1234`. Numeric label values and existing Secret or ServiceAccount
names remain supported.

Every key is documented in `values.yaml`. The table below lists the keys most
installations set: the required connection and image settings, plus common
authentication, exposure and runtime options.

| Key | Meaning |
| --- | --- |
| `image.repository`, `image.tag` or `image.digest` | Required. Exactly one of tag or digest. The repository is lowercase and carries no tag or digest (OCI distribution reference syntax); `temporal.uiProxy.image` and `tests.image` follow the same rules. |
| `publicUrl` | Browser-facing `scheme://host[:port]`, no path. A colon must be followed by a port. With `ingress.enabled`, or `httpRoute.enabled` and empty `httpRoute.hostnames`, the host must be a DNS name, not an IP address. Default `http://localhost:6787`. |
| `environmentId` | `MAESTRO_ENVIRONMENT_ID`. Empty means the release name. |
| `workload.kind`, `workload.selectorLabels` | `Deployment` (default) or `StatefulSet` with stable per-replica DNS. An explicit selector map can adopt an existing immutable workload selector; see [Workload identity](#workload-identity). |
| `database.existingSecret`, `database.connectionStringKey` | Secret with the PostgreSQL URI (key default `uri`). Required. |
| `database.poolMaxConnections` | `MAESTRO_DB_POOL_MAX_CONNECTIONS`; `0` leaves the binary default. |
| `database.migrateOnStartup` | `false` (default): the bootstrap chart migrates the schema. `true`: NRO migrates it at startup. See [Database migrations](#database-migrations). |
| `temporal.address`, `temporal.namespace` | Frontend `host:port` and an existing namespace. Required. |
| `temporal.auth.mode` | `none`, `apiKey` or `mtls`, with the matching Secret references. |
| `temporal.uiUrl` | Link to the namespace in the Temporal UI; derived when the proxy is on. Its rules are below the table. |
| `temporal.ui.service`, `temporal.uiProxy.enabled` | Temporal UI Service and the nginx `/temporal` proxy. `temporal.uiProxy.image` takes exactly one of tag or digest. |
| `auth.mode`, `auth.dex.*`, `auth.teleport.*`, `auth.trustedJwtIssuers` | How users sign in: `dex` (default), `developmentNone`, `nvproxy`, `teleport` or `oidcProxy`. `auth.dex` and `auth.teleport` hold the settings of those two modes, and `auth.trustedJwtIssuers` the token issuers of `nvproxy` and `oidcProxy`; see [Authentication modes](#authentication-modes). |
| `auth.authorizationProvider`, `auth.siteAdminGroups`, `auth.allowEmptySiteAdminGroups` | Who administers NRO; see [Authorization](#authorization). |
| `config.mode`, `config.toml`, `config.extraToml`, `config.existingConfigMap` | Tenant configuration source. |
| `relatedEnvironments` | Links to other NRO environments, rendered as `[[environments]]`. |
| `telemetry.metricsEndpoint`, `telemetry.tracesEndpoint` | OTLP/HTTP `host:port`; unset when empty. |
| `ingress.*`, `httpRoute.*` | Exposure through Ingress or Gateway API (not both). |
| `metrics.serviceMonitor.*` | Prometheus Operator ServiceMonitor for `/metrics`. `scrapeTimeout` must not exceed `interval`. `labels` override `commonLabels`, and chart-owned label keys override both. |
| Label, annotation and selector maps | Keys follow Kubernetes key syntax. The maps are listed below the table. |
| `replicaCount`, `deploymentStrategy`, `podDisruptionBudget.*` | Scale, rollout and availability. |
| `networkPolicy.*`, `kubernetesAccess.*` | Network restriction and namespace-scoped module RBAC. |
| `extensions.<name>.*` | Pod settings and TOML configuration fragments supplied by extensions ([Extensions](#extensions)). |
| `extraEnv`, `extraEnvFrom`, `extraVolumes`, `extraVolumeMounts` | Integration hooks for modules. |
| `serviceAccount.create`, `serviceAccount.name` | The chart creates the ServiceAccount by default; with `create: false`, `name` is required and must name an existing one. |

When you set `temporal.uiUrl`, use an absolute HTTP(S) URL with a host and no query or
fragment. Its decoded path must end with `/namespaces/<temporal.namespace>/`, for example
`https://temporal.example.org/namespaces/remediation-orchestrator/`, because NRO appends
`workflows/<workflow ID>/<run ID>/history` to it. Percent-encoded namespace characters are
accepted.

These label, annotation and selector maps take keys in Kubernetes key syntax:
`commonLabels`, `commonAnnotations`, `podLabels`, `podAnnotations`,
`workload.selectorLabels`, `nodeSelector`, every `annotations` map,
`metrics.serviceMonitor.labels`, `temporal.uiProxy.networkPolicy.webPodSelector`,
`auth.teleport.serviceLabels` and `auth.teleport.serviceAnnotations`. A key is a name of
at most 63 characters, optionally after a lowercase DNS subdomain prefix of at most 253
characters and `/`. `webPodSelector` needs at least one label.

## How the public URL is used

`publicUrl` is the single place to say where users reach NRO. Set it to the
URL people type in the browser, and these follow from it:

| Derived value | Result |
| --- | --- |
| `MAESTRO_HOST` | host and port of `publicUrl` |
| `MAESTRO_AUTH_REDIRECT_URL` | `publicUrl` + `/auth/callback` (dex mode). Register this redirect URI in the Dex client. |
| Dex issuer | `publicUrl` + `/auth/dex`, unless `auth.dex.issuerUrl` is set. Configure Dex with the same issuer. |
| Ingress and HTTPRoute host | hostname of `publicUrl` (`ingress.extraHosts` and `httpRoute.hostnames` add or replace hosts) |
| `temporal_ui_base_url` | Chart-rendered `config.toml` only: `temporal.uiUrl`, else `publicUrl` + `/temporal/namespaces/<namespace>/` when the proxy is enabled, else not written |

Dex mode requires an `https://` `publicUrl`. For a loopback-only development
install over plain HTTP, set `development.allowInsecureHttp: true` together with
an `http://localhost` or `http://127.0.0.1` `publicUrl`, with or without a port. This
also requires ClusterIP and no Ingress or HTTPRoute. Every other mode rejects
`development.allowInsecureHttp: true`.

In nvproxy and teleport modes the chart exposes nothing itself (see
[The proxy modes](#the-proxy-modes)), but `publicUrl` still sets
`MAESTRO_HOST` and the Temporal UI link. Set it to the address users reach through the
proxy or Teleport. In oidcProxy mode it also names the HTTPRoute host when `httpRoute` is on.

## Authentication modes

| `auth.mode` | Use it when | Who verifies the identity |
| --- | --- | --- |
| `dex` (default) | Users sign in through an existing Dex; optionally accept verified NVProxy tokens | NRO, against Dex or configured trusted JWT issuers |
| `developmentNone` | You run an isolated development cluster | Nobody |
| `nvproxy` | A proxy forwards the token in the `X-Nvproxy-Auth-Token` header or the `nvproxyIdToken` cookie | The proxy, then NRO against `auth.trustedJwtIssuers` |
| `teleport` | Teleport application access is the entry point | NRO, against the Teleport cluster's keys |
| `oidcProxy` | An OIDC-terminating proxy forwards a standard bearer token | The proxy, then NRO against `auth.trustedJwtIssuers` |

`dex` is the default. Use it with an existing Dex. Behind a proxy, use `oidcProxy` for any
proxy that forwards a standard bearer token. `nvproxy` applies only to a proxy that
forwards the token in the `X-Nvproxy-Auth-Token` header or the `nvproxyIdToken` cookie.

### dex

`auth.mode: dex` (default) signs users in through an existing Dex. The chart turns on UI
authentication and fails unless `auth.dex.backendUrl`, `clientId` and `existingSecret` are
set. The Secret holds the client secret under `clientSecretKey` (default
`client-secret`). NRO proxies Dex under `/auth/dex`, and the backend URL is the in-cluster
Dex root, such as `http://dex.identity.svc:5556`.

For the current NRO login page, `grpcAddress` must point to a working connector-list API.
Enable `DEX_API_CONNECTORS_CRUD=true` in Dex and configure at least one connector. The
chart accepts an empty address, but the current application has no generic sign-in
fallback. An empty address or a failed connector request can leave login unavailable.
The client uses plaintext gRPC, so keep that port on a protected network.

To accept verified NVProxy header or cookie tokens alongside Dex browser login,
set a nonempty `auth.trustedJwtIssuers` list. Dex and its client Secret remain
configured. Any client that reaches NRO can present a token, so select issuers
and audiences for intended callers and use RBAC to limit access. With
`auth.authorizationProvider: none`, every verified caller has full access.
Leave the list empty for Dex-only. This does not enable OIDC bearer-token mode.

Configure Dex's issuer as `publicUrl` + `/auth/dex` and leave `auth.dex.issuerUrl`
empty for the supplied routing. The current application rewrites discovered
authorization URLs to paths on the NRO origin, where it proxies only `/auth/dex/`.
Setting a different issuer does not automatically route its endpoints; custom
issuer paths need separately verified proxy routing.

Choose a Dex connector that emits explicit group claims. Before you rely on it, verify
login, administrator access, denial of non-administrators and rejection of forged headers
against your connector. Only dex reads the `auth.dex` keys and
`development.allowInsecureHttp`. Every other mode rejects a non-empty `issuerUrl`,
`backendUrl`, `existingSecret` or `grpcAddress`, and `allowInsecureHttp: true`.

### developmentNone

`auth.mode: developmentNone` disables login and authorization entirely. It
needs `development.allowUnauthenticated: true` and rejects Ingress, HTTPRoute,
NodePort/LoadBalancer, onboarding, dynamic modules and the Temporal UI proxy.
Other workloads in the cluster can still reach the ClusterIP Service, so use an
isolated cluster.

### The proxy modes

`nvproxy`, `teleport` and `oidcProxy` are the proxy modes: an identity layer in front of the
service authenticates users, and it must be the only path to the pod. In each of them the
chart:

- requires `networkPolicy.enabled: true` with `ingressPeers` that select only the proxy or
  Teleport agent pods, checked as described below;
- requires `service.type: ClusterIP`, because a NodePort or LoadBalancer Service reaches the
  pod from outside the cluster, often from a node address that no peer can tell apart from
  the proxy;
- rejects Ingress, which would reach the pod without the identity layer;
- sets `MAESTRO_REQUIRE_UI_AUTH=true`, so a request that reaches the pod without an identity
  cannot open a REPL session, even with `auth.authorizationProvider: none`.

Every `networkPolicy.ingressPeers` entry must carry `matchLabels` or `matchExpressions` on its
`podSelector` or `namespaceSelector`, or an `ipBlock` whose `cidr` is an address with a
prefix from `/8` to `/32` for IPv4 or `/32` to `/128` for IPv6. A `namespaceSelector` needs
labels or expressions of its own whenever it is present. `namespaceSelector: {}` beside a
labelled `podSelector` selects that label in every namespace, so a pod anywhere in the
cluster could pass as the proxy. Omit `namespaceSelector` to stay in the release namespace.
The chart rejects these open shapes with a message that names the peer. It cannot tell
whether a labelled selector or a narrow CIDR covers only the proxy. You must check that.
Prefer selectors, because an `ipBlock` admits every workload in its range.
The prefix check reads the CIDR as written. An IPv4-mapped IPv6 range such as
`::ffff:0.0.0.0/96` passes it, yet Kubernetes' CIDR parser reads that range as
`0.0.0.0/0`, every IPv4 address. Do not use IPv4-mapped ranges.

### nvproxy

`auth.mode: nvproxy` is for a proxy that authenticates users and forwards their identity
token in the `X-Nvproxy-Auth-Token` header or the `nvproxyIdToken` cookie.
The proxy must set or strip both on every request it forwards. NRO accepts the token only
when it verifies against an `auth.trustedJwtIssuers` entry (see [Trusted JWT issuers](#trusted-jwt-issuers)).
The chart sets
`MAESTRO_DISABLE_NVPROXY_AUTH=false`,
`MAESTRO_AUTHORIZATION_PROVIDER` from `auth.authorizationProvider` and
`MAESTRO_SITE_ADMIN_GROUPS` (see [Authorization](#authorization)), and leaves every Dex
variable empty. The proxy, its login flow and its route to the `/temporal` UI live outside
the chart, so the chart also rejects HTTPRoute and the Temporal UI proxy.

### teleport

`auth.mode: teleport` is for Teleport application access. The Teleport agent forwards each
request with a signed `Teleport-Jwt-Assertion` header, and NRO verifies it against the
JWKS of `auth.teleport.issuer` (the Teleport cluster name, required) with the expected
audience. The chart sets:

| Variable | Value |
| --- | --- |
| `MAESTRO_ENABLE_TELEPORT_AUTH` | `true` |
| `MAESTRO_TELEPORT_ISSUER` | `auth.teleport.issuer` |
| `MAESTRO_TELEPORT_AUDIENCE` | `auth.teleport.audience` (no surrounding whitespace; the binary rejects a blank value), else `http://<frontend Service>.<namespace>.svc.<auth.teleport.clusterDomain>:<port>` |
| `MAESTRO_TELEPORT_JWKS_URL` | `auth.teleport.jwksUrl`, only when set. The binary requires `https://`, or `http://` on `localhost`, `127.0.0.1`, `[::1]` or an in-cluster Service host ending in `.svc` or `.svc.cluster.local`. The chart also rejects user information, a query or a fragment. When it is unset, the binary uses `https://<issuer>/.well-known/jwks.json`. |

The frontend Service is the nginx proxy Service when `temporal.uiProxy.enabled` is true.
Otherwise, it is the NRO Service. The chart sets the annotation
`teleport.dev/name: <auth.teleport.appName>` on it, and `appName` is required in this
mode. The chart also adds `auth.teleport.serviceAnnotations` and
`auth.teleport.serviceLabels`, so a Teleport agent with Kubernetes app discovery can
publish the Service. The derived audience matches the URI such an agent uses. Set
`audience` when your Teleport app uses another URI. The Teleport agent and its app
definition live outside the chart. The chart also rejects HTTPRoute. The Temporal UI
proxy is allowed, and nginx forwards the Teleport header to the authorization check.

NRO reads group names from the JWT's `traits.groups` and role names from its `roles`
claim. `auth.siteAdminGroups` and tenant `[[rbac.group_mappings]]` entries match
`traits.groups`, so NRO sees groups only when the Teleport JWT carries a `groups` trait.
`[[rbac.role_mappings]]` `claim_role` values match Teleport role names.

This sign-in mode is separate from the `teleport` application module that tenants
configure under `[modules.teleport]` ([Teleport module](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/modules/teleport/README.md)).

### oidcProxy

`auth.mode: oidcProxy` is for an OIDC-terminating proxy in front of the service, such as
an Envoy Gateway `SecurityPolicy` or oauth2-proxy. The proxy must authenticate every
request to the route, browsers and bearer tokens alike, and forward the token in the
`Authorization: Bearer` header or the `nvproxyIdToken` cookie. The chart sets
`MAESTRO_ENABLE_OIDC_AUTH=true`, keeps `MAESTRO_DISABLE_NVPROXY_AUTH=false` and leaves every
Dex variable empty.

NRO reads the claims of the first token it finds in the `Authorization` header, the
`X-Nvproxy-Auth-Token` header or the `nvproxyIdToken` cookie, in that order. The proxy must
validate or strip all three before forwarding the request. An Envoy Gateway
`SecurityPolicy` does this when its JWT provider extracts tokens from all three and its
authorization denies requests without a valid token. NRO also accepts each of these tokens
only when it verifies against an `auth.trustedJwtIssuers` entry (see
[Trusted JWT issuers](#trusted-jwt-issuers)).

The NVProxy provider stays on because an OIDC proxy can carry a browser session in a cookie
alone: an Envoy Gateway `SecurityPolicy` can name its ID-token cookie `nvproxyIdToken`, and
the browser's requests then reach NRO with no `Authorization` header. Without the NVProxy
provider those sessions would have no identity.

The chart cannot verify that the proxy's policy exists or covers the route. The rendered
NetworkPolicy restricts sources only when the cluster enforces it. Verify that its peers
and any other effective policies admit only the intended identity layer. `httpRoute` is
allowed and is where a Gateway policy usually attaches, but the chart does not require it.
For Envoy Gateway, select the Envoy data plane pods in `ingressPeers`. The Temporal UI
proxy is allowed, and nginx forwards the cookie and `Authorization` header to the
authorization check.

### Trusted JWT issuers

`nvproxy` and `oidcProxy` require at least one `auth.trustedJwtIssuers` entry. `dex` accepts
an optional nonempty list to enable verified NVProxy tokens alongside browser login.
`teleport` and `developmentNone` reject a nonempty list. NRO accepts a token only
when the entry for its issuer verifies its RS256 or ES256 signature with the keys at
`jwksUrl`, its `issuer`, its `audience`, and its expiry. List each issuer whose
tokens NRO should accept, once each:

```yaml
auth:
  trustedJwtIssuers:
    - issuer: https://idp.example.org
      audience: remediation-orchestrator
      jwksUrl: https://idp.example.org/keys
```

The binary requires `jwksUrl` to use `https://`, or `http://` on `localhost`, `127.0.0.1`,
`[::1]` or an in-cluster Service host ending in `.svc` or `.svc.cluster.local`. The chart
also rejects user information, a query or a fragment. The chart passes the list to
`MAESTRO_TRUSTED_JWT_ISSUERS` as JSON.

### Environment by mode

| `auth.mode` | `MAESTRO_DISABLE_NVPROXY_AUTH` | `MAESTRO_ENABLE_OIDC_AUTH` | `MAESTRO_ENABLE_TELEPORT_AUTH` | `MAESTRO_TRUSTED_JWT_ISSUERS` | `MAESTRO_REQUIRE_UI_AUTH` | `MAESTRO_AUTHORIZATION_PROVIDER` |
| --- | --- | --- | --- | --- | --- | --- |
| `dex` | `true` when issuers empty; otherwise `false` | `false` | `false` | unset when empty; otherwise `auth.trustedJwtIssuers` | `true` | `auth.authorizationProvider` |
| `developmentNone` | `true` | `false` | `false` | unset | `false` | `none` |
| `nvproxy` | `false` | `false` | `false` | `auth.trustedJwtIssuers` | `true` | `auth.authorizationProvider` |
| `teleport` | `true` | `false` | `true` | unset | `true` | `auth.authorizationProvider` |
| `oidcProxy` | `false` | `true` | `false` | `auth.trustedJwtIssuers` | `true` | `auth.authorizationProvider` |

`MAESTRO_REQUIRE_UI_AUTH=true` sends unauthenticated browsers to the Dex login only in dex
mode. In the proxy modes, its effect is that the REPL refuses to create or list sessions
for a caller without an identity and lists only the caller's own sessions. Reading an
existing session needs the `repl:read` scope, which only `rbac` authorization checks.

### Authorization

`auth.authorizationProvider: rbac` (default) derives roles from group claims, and users in
`auth.siteAdminGroups` are site administrators. Write each group without commas or
surrounding whitespace. With `rbac` an empty list fails, because
every administrator route would be unreachable; set `auth.allowEmptySiteAdminGroups: true`
to deploy that way on purpose. The flag fails once groups are listed, so remove it then.

`auth.authorizationProvider: none` disables scope checks and is the binary's default.
With it, `auth.siteAdminGroups` must be empty and `auth.allowEmptySiteAdminGroups` must
stay `false`. The provider does not itself require an identity, so in the proxy modes
most routes rely on the external proxy to authenticate requests. The REPL and Temporal UI
exceptions are in [Environment by mode](#environment-by-mode) and
[Temporal UI proxy](#temporal-ui-proxy). In developmentNone mode, the chart accepts either
provider, always renders `none` and rejects `auth.allowEmptySiteAdminGroups: true`.
Outside developmentNone mode, `helm install` and `helm upgrade` warn when authorization
is disabled or the administrator group list is explicitly allowed to be empty.

### Temporal credentials

Temporal credentials are separate. `temporal.auth.mode: apiKey` needs
`apiKey.existingSecret`. `mtls` needs `mtls.existingSecret`, with optional `caKey` and
`serverName`, and the chart mounts the files at `/var/remediation-orchestrator/temporal-tls`.
The two are mutually exclusive. `certKey`, `keyKey` and `caKey` must name distinct keys of
that Secret, and `caKey` and `serverName` are accepted only with `mtls`. Secret contents
never appear in rendered output.

## Temporal UI proxy

Set `temporal.uiProxy.enabled: true` and `temporal.ui.service` to put an nginx
Deployment and Service in front of NRO. nginx serves the Temporal UI under
`/temporal/`. It checks each request with NRO's `/internal/authz/temporal` before
forwarding it.

Requirements:

- The proxy requires `auth.mode: dex`, `teleport` or `oidcProxy`, so users can
  authenticate and receive authorization.
- It also requires `auth.authorizationProvider: rbac` with at least one
  `auth.siteAdminGroups` entry. The `/internal/authz/temporal` endpoint admits site
  administrators only, and denies every request while authorization is not enforced.
  Either opt-out would therefore leave the Temporal UI unreachable for everyone.
- The Temporal UI itself must run with `TEMPORAL_UI_PUBLIC_PATH=/temporal`. The supplied
  Helmfile sets this automatically on its managed UI when the proxy is enabled.

Behavior:

- nginx returns 404 for `/internal/` and `/metrics`. Its catch-all route forwards other
  paths to NRO.
- Ingress and HTTPRoute route to the nginx Service (port 80) instead of the NRO Service.
- A request for `/temporal` without the trailing slash gets a relative 301 to
  `/temporal/`, keeping its query string. Every redirect nginx generates is relative.
  This preserves the browser's scheme, host and port behind TLS termination.
- nginx accepts request bodies up to 100m.
- With `networkPolicy.enabled`, the chart also limits the Temporal UI pods (selected by
  `temporal.uiProxy.networkPolicy.webPodSelector`, in the release namespace) to traffic
  from nginx.
- The proxy assumes the NRO binary serves `/internal/authz/temporal`, answering 204 to
  allow, 401 when unauthenticated and 403 when forbidden.

`temporal.ui.port` is the Service port nginx connects to. The NetworkPolicy uses
`temporal.uiProxy.networkPolicy.webPodPort` for the destination pod port instead.
It defaults to `8080` and accepts either a port number or a named container port
such as `http`. For a Service with `port: 80` and `targetPort: 8080`, set
`temporal.ui.port: 80` and leave `webPodPort: 8080`.

## Extensions

`extensions` is a map keyed by extension name, a lowercase DNS label of at most 45
characters. Each entry adds pod settings or managed TOML without forking the chart,
through six fields: `env`, `ports`, `volumes`, `volumeMounts`, `singleReplica` and
`configToml`. A null entry is a no-op.

Extensions render in name order, after the chart's own entries and before `extraEnv`,
`extraVolumes` and `extraVolumeMounts`. With `networkPolicy.enabled`, each port gets its
own ingress rule. `singleReplica: true` requires `replicaCount: 1` and
`deploymentStrategy.type: Recreate`.

The chart rejects collisions with the chart's own names and paths and with other
extensions, and the message names the key. It compares mount paths after normalization,
so a path that repeats, contains or sits inside another mount collides. As a result, no
extension can mount over `/var/run/secrets/kubernetes.io/serviceaccount`, where the
service-account token lives, or over `/etc/ssl/certs`. The chart resolves no symbolic
links, and it checks no other system trust-store location. An extension can still mount
certificates at `/etc/pki/tls/certs`, or set `SSL_CERT_FILE` or `SSL_CERT_DIR` in its
`env`, and NRO's TLS clients that use the system roots then trust them. Review an
extension's mounts and variables before you enable it.

A port's `ingressFrom` picks the sources of its rule:

| `ingressFrom` | Sources admitted to the port |
| --- | --- |
| `ingressPeers` (default) | `networkPolicy.ingressPeers`, without the nginx peer; every source when that list is empty |
| `portPeers` | Only the port's own `ingressPeers` list of NetworkPolicy peers, which needs at least one entry |
| `any` | Every source |

A port's `ingressPeers` is accepted only with `ingressFrom: portPeers`. Use `portPeers`
when a port needs sources that must not reach the HTTP port. For example, a Gateway may
front a call-home listener while only an identity proxy may reach 6787. The port's rule
names only that port, so its peers never reach 6787 or nginx. The proxy modes' peer
checks still apply to `networkPolicy.ingressPeers` alone.

An extension volume has a `name` and exactly one source from an allow list: `configMap`,
`secret`, `emptyDir`, `persistentVolumeClaim`, or `projected` whose sources are
`configMap`, `secret` or `downwardAPI`. The schema rejects every other source, so an
extension cannot mount a node path (`hostPath`), reach storage drivers (`csi`, `nfs`) or
project a token for the NRO ServiceAccount (`serviceAccountToken`), which the pod
otherwise does not mount. The operator's own `extraVolumes` take any source.

When the schema rejects an extension volume source, the error names it, for example
`- at '/extensions/<name>/volumes/<i>': additional properties 'hostPath' not allowed`,
followed by a `'oneOf' failed` list of the allowed sources. A rejected projected source
reports at `.../projected/sources/<j>`. A volume with two sources fails with
`'oneOf' failed, subschemas <m>, <n> matched`, for example `subschemas 0, 1 matched` for
`configMap` plus `secret`.

The Helmfile in this module does not set this map, and its `remediation-orchestrator`
passthrough rejects it.

## Configuration and scripts

A tenant is a configuration and script scope within one NRO installation. Application
modules are integrations configured under `[modules.<name>]` in its TOML configuration;
they are separate from the `nro_helm` Bazel module.

`config.mode: managedFile` mounts `/etc/remediation-orchestrator/config.toml` from exactly one of
`config.toml` (rendered into a chart ConfigMap) or `config.existingConfigMap`
(which must contain the key `config.toml`). NRO uploads this file to the
default tenant on every start, so Helm-owned configuration overwrites UI edits.
The chart hashes its rendered configuration into the pod's `checksum/config`
annotation to restart NRO when that configuration changes. This
computed value takes precedence over `podAnnotations`; other pod annotations are
preserved.

`config.mode: database` mounts nothing and keeps configuration in the database.
`config.toml` and `existingConfigMap` must then be empty.

`config.toml` and `config.extraToml` are not passed through Helm `tpl`, so `{{ }}`
text remains literal. Keep secrets out of the file and use
the module's `{env:NAME}` or `{file:/path}` references.

For chart-rendered TOML the file is built in this order: `temporal_ui_base_url`
(when known, see above), `config.toml`, `config.extraToml`, then one
`[[environments]]` table per `relatedEnvironments` entry (`name`, `url`, and
optional `color` and `description`). Do not set a top-level `temporal_ui_base_url`
yourself when the chart writes it, because the render then fails. `extraToml` and
`relatedEnvironments` need `config.toml` and are rejected with an external ConfigMap or
database mode.

The chart parses this assembled document on every render with Helm's native TOML parser, even
when no extension contributes configuration. `extraToml` is appended as text, so it must
not repeat a key or table header from `config.toml` (add keys to an existing table in
`config.toml` itself), and `config.toml` must not define a plain `[environments]` table when
`relatedEnvironments` is set. A fragment without a table header continues the last table
of `config.toml`, so start `extraToml` with a header. If the parser rejects the document,
the chart fails with a message naming `config.toml`, `config.extraToml` and the generated
settings. It withholds the parser's own message because that message can quote
configuration values.

TOML handling depends on the Helm version. Use TOML 1.0 syntax when you share values
across Helm versions. Helm 4.1 and later also accept TOML 1.1. The chart parses its TOML
with Helm's native `fromToml` and serializes merged extension fragments with native
`toToml`, both present in Helm 3.19.4 and 4.x. The chart checks the encoded text. If
encoding fails, the chart fails with a fixed message and never prints the encoder output,
which can quote configuration values. Each Helm version bundles its own TOML library
([v1.5.0](https://raw.githubusercontent.com/BurntSushi/toml/v1.5.0/README.md) in
3.19.4 and 4.0, [v1.6.0](https://raw.githubusercontent.com/BurntSushi/toml/v1.6.0/README.md)
from 4.1), so rendered TOML formatting can differ. The
[validation limits](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/helm/VALIDATION.md#limits) describe the tested Helm versions.

Only Helm 4.1 and later reject duplicate array-valued keys. Helm 3.19.4 and 4.0 parsers
accept repeated array-valued keys. When no extension contributes configuration, those
invalid duplicates remain in the rendered TOML. When an extension contributes
configuration, re-encoding silently keeps the last array. Do not rely on those versions
to catch this case. Lint or render the same values with Helm 4.1 or later for strict
duplicate-key validation.

Extensions can add literal TOML through `configToml`, in `[modules.<module>]` tables
only; the chart rejects a fragment that sets any other key. The chart merges fragments
into the complete managed document and rejects conflicting values or types; an
extension cannot override operator settings. A conflict message names the extension, the
dotted key and the owner of the existing value: `config.toml or config.extraToml`, or an
earlier extension in name order. A fragment counts only when it parses to a nonempty
table, so blank and comment-only fragments are no-ops, while a table header alone
(`[modules.x]`) adds that table. Fragments that count require chart-rendered `config.toml`
and fail with database mode or an existing ConfigMap. Composition can reformat TOML and
remove comments; without such fragments the original rendering is preserved byte for byte.

The chart does not ship or load scripts. Deploy them to each tenant through the
script bundle API, a plan request and then a deploy request. `maestroctl scripts deploy`
does both from a script repository, as the
[script deployment guide](/remediation-orchestrator/guides/deploying-scripts)
describes; the Helm module's [script deployment overview](/remediation-orchestrator/deployment/helm/operations/maintenance#deploy-workflow-scripts)
summarizes it.
With any mode other than `developmentNone`, the caller needs the
`script-uploader` role in the tenant. The chart sets
`MAESTRO_LOAD_SCRIPTS_FROM_FOLDER` and `MAESTRO_LOAD_LATEST_SCRIPTS_AT_STARTUP`
empty, so the legacy startup loader stays off.

## Workload identity

The default `workload.kind: Deployment` and its name/instance/component selector
remain unchanged. Choose `StatefulSet` to render one server StatefulSet and a
headless governing Service named `<fullname>-replicas`. Its pods resolve as
`<fullname>-<ordinal>.<fullname>-replicas.<namespace>.svc`. The Service publishes
addresses before readiness, so peer startup does not depend on rollout order.
`replicaCount` and extension container ports apply to both kinds. StatefulSet uses
parallel pod creation and Kubernetes' ordered rolling update. The Deployment-only
`deploymentStrategy` must stay at its default.

Leave `workload.selectorLabels` empty for a new installation. Set an explicit selector
only to adopt an existing workload.

The empty default derives the chart's name/instance/component selector. For an existing
workload, provide its **exact** immutable matchLabels map instead. Name and instance must
still match the chart identity. This immutable selector controls the server workload,
and the server pod labels include it.

The server Service, NetworkPolicy, PodDisruptionBudget and governing Service select the
chart-owned server component pod label instead. The ServiceMonitor selects only the
server Service, by its component metadata label. Those resources do not cover existing
pods that lack the component label until the adopted workload replaces them. A
pre-existing controller selector without a distinguishing label can also match proxy or
test pods. Kubernetes owner references keep controllers to their own pods.

For example, a pre-existing StatefulSet with a selector containing a separate
replica identity could use:

```yaml
fullnameOverride: example-orchestrator
workload:
  kind: StatefulSet
  selectorLabels:
    app.kubernetes.io/name: remediation-orchestrator
    app.kubernetes.io/instance: example
    example.com/replica-mode: stable
```

Use release `example` for that example. Before adopting an existing StatefulSet,
verify its name, exact selector, governing Service and `podManagementPolicy: Parallel`.
The chart sets that policy and Kubernetes cannot change it on an existing
StatefulSet. An existing `OrderedReady` controller needs a separately planned
controller replacement, not an ordinary Helm update. Orphaning pods during a
replacement requires explicit operational review. Changing the selector also
requires replacement. By default, Helm requires an existing resource to have
`app.kubernetes.io/managed-by: Helm` and this release's
`meta.helm.sh/release-name` and `meta.helm.sh/release-namespace` annotations.
Other deployment tools apply their own adoption rules.

On a normal upgrade of the **same Helm release**, Helm creates the desired kind
before deleting the old controller. A Deployment-to-StatefulSet change can thus
run both controllers temporarily, even with the Deployment's `Recreate` strategy.
Plan a cutover that prevents overlapping workers. A workload managed by another
release or controller has a different owner. This chart does not retire it, so
coordinate its retirement separately. Resource keep policies and other deployment
controllers can change deletion behavior. Neither rendered manifests nor these
examples prove a live cutover or multi-replica module behavior.

## Plain-Helm call-home wiring

[The call-home overlay](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/helm/charts/remediation-orchestrator/examples/callhome.yaml) applies to the
[secure example](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/helm/charts/remediation-orchestrator/examples/secure.yaml). Preview it without a cluster from the
Helm module root:

```sh
helm template custom ./charts/remediation-orchestrator --namespace custom-namespace \
  -f ./charts/remediation-orchestrator/examples/secure.yaml \
  -f ./charts/remediation-orchestrator/examples/callhome.yaml \
  --api-versions monitoring.coreos.com/v1/ServiceMonitor
```

Release `custom` creates pods `custom-remediation-orchestrator-0` and `-1` under
the StatefulSet. The pod-name downward API supplies each replica ID. The
headless `custom-remediation-orchestrator-replicas` Service makes an individual
replica reachable at `<pod-name>.custom-remediation-orchestrator-replicas.custom-namespace.svc.cluster.local`.
The suffix in `MAESTRO_AGENT_CALL_HOME_REPLICA_DNS_DOMAIN` must match the actual
namespace and cluster DNS domain. The chart's HTTP Service and Ingress expose
only 6787. Its headless `-replicas` Service includes 9876 for peer addressing,
but the chart creates no agent-facing Service or route. You must supply a
TLS-passthrough route from the gateway to the server pods on 9876. The gateway must not
terminate gRPC mTLS. The 9876 NetworkPolicy rule admits
the gateway pods in `gateway-system` and the NRO server pods for forwarding.
The 6787 rule does not admit server pods.

Before installing, supply the image and all external services, the bootstrap
migration Job, Dex, and the existing database, Temporal, and call-home Secrets
named by the two values files.

Certificate requirements:

- Keys: `example-callhome-tls` must contain `tls.crt`, `tls.key`, and `ca.crt`.
- Extended key usage: the same key pair serves as the listener certificate and the
  replica-to-replica client certificate, so its extended key usage must include both
  `serverAuth` and `clientAuth`.
- DNS SAN: the key pair needs a DNS SAN for `callhome.example.org`, the replica TLS server name.
- URI SANs: the key pair needs exactly one Maestro identity URI SAN,
  `spiffe://example.org/maestro/replica/<dns-label>`. Agent certificates carry exactly one
  Maestro identity URI SAN, `spiffe://example.org/maestro/agent/<tenant-uuid>/<site-id>`.
- CA: `ca.crt` must verify both Agent and replica certificates. The listener uses it to
  verify clients, and replica clients use it to verify servers.
- TLS 1.3: the listener requires TLS 1.3 and client certificates.

Replace these synthetic names, trust domain, certificates and ingress selectors for the
target environment. The example is a rendering guide, not proof that credentials, peer
routing or TLS work live.

## Operational notes

Each row names a behavior to plan for and the values that configure it. Longer topics
have their own sections below.

| Topic | What to know | Configured by |
| --- | --- | --- |
| Rollout | Deployment uses `Recreate` by default; StatefulSet uses parallel pod creation and ordered rolling updates. A same-release kind change creates the new controller before deleting the old one; plan for overlap. | `workload.kind`, `deploymentStrategy` |
| Bootstrap | Install `remediation-orchestrator-bootstrap` with `--wait --wait-for-jobs` before this chart; it prepares Temporal and, by default, migrates the schema. See [Database migrations](#database-migrations). | the bootstrap chart, `database.migrateOnStartup` |
| External configuration | Helm cannot checksum external ConfigMaps or Secrets. After changing one, restart the selected workload (`kubectl rollout restart`) or use a reloader. Chart-rendered config rolls the pods automatically. | `config.existingConfigMap`, credential Secrets |
| Health checks | `/healthz` and `/readyz` are shallow on purpose, so the UI stays up when a dependency is down. `helm test` calls `/status`, which checks the database and Temporal. Exposure of these paths is covered in [Endpoints without authentication](#endpoints-without-authentication). | `probes`, `tests` |
| Pod security | By default the pod runs non-root (UID 10001) with a read-only root filesystem, dropped capabilities, the RuntimeDefault seccomp profile and no service-account token. Module RBAC below mounts one. You may add fields within the limits listed below the table. | `podSecurityContext`, `securityContext` |
| Module RBAC | `kubernetesAccess.enabled` adds a namespace-scoped Role and mounts the token. Rules are required; wildcards and nonResourceURLs are rejected, and no ClusterRole is made. | `kubernetesAccess` |
| Disruption budget | `enabled: auto` creates the budget only when `replicaCount > 1`; `true` requires at least two replicas. Set exactly one of `minAvailable` and `maxUnavailable`, and the other to `null`. | `podDisruptionBudget` |
| NetworkPolicy | Off by default; the proxy modes require it, and it needs a CNI that enforces NetworkPolicy. Refer to [NetworkPolicy](#networkpolicy). | `networkPolicy` |
| Extra env and volumes | `extraEnvFrom` supplies module variables. Explicit chart, extension and `extraEnv` entries take precedence over it. The name and path rules are listed below the table. | `extraEnv`, `extraEnvFrom`, `extraVolumes`, `extraVolumeMounts` |
| ServiceMonitor | Scrapes `GET /metrics` on the `http` port of the NRO Service. Requires the cluster (or `--api-versions`) to report `monitoring.coreos.com/v1/ServiceMonitor`; the bare group is not enough, and enabling it without that API fails the render. | `metrics.serviceMonitor` |
| HTTPRoute | Requires the cluster (or `--api-versions`) to report `gateway.networking.k8s.io/v1/HTTPRoute`; enabling it without that API fails the render. | `httpRoute` |
| Telemetry | Optional. When empty the variables are not set and the binary default (127.0.0.1:4318) applies, which logs export errors if nothing listens there. | `telemetry` |
| Renames | Changing `nameOverride` or the release name changes workload selectors, and `fullnameOverride` renames resources (including the StatefulSet governing Service). Plan replacements before changing them on an existing installation. | `nameOverride`, `fullnameOverride` |
| Null overrides | A `null` override fails validation; see [Null overrides](#null-overrides). | every key |

For pod security, you may add fields, but the chart rejects:

- `runAsNonRoot` other than `true`
- a seccomp profile other than `RuntimeDefault` or `Localhost`
- a writable root filesystem
- privilege escalation
- a `capabilities.drop` without `ALL`

For extra environment variables and volumes:

- Database, Dex and Temporal credentials come from their dedicated Secret references,
  not `extraEnvFrom`.
- A variable that the chart does not set, including one that starts with `MAESTRO_`, can
  come from an `extraEnvFrom` source. Treat those ConfigMaps and Secrets as trusted
  configuration.
- `extraEnv` names must be unique, cannot start with `MAESTRO_` and cannot repeat an
  extension's env name.
- `extraVolumes` cannot use `tmp`, `config`, `temporal-tls` or an extension's volume
  names.
- `extraVolumeMounts` cannot overlap the chart's paths or an extension's mounts.

## NetworkPolicy

`networkPolicy` is off by default. The [proxy modes](#the-proxy-modes) require it with
`ingressPeers` and also check each peer. It needs a CNI that enforces NetworkPolicy.

An empty `ingressPeers` allows all sources. Extension ports follow it unless they set
`ingressFrom: any` or `portPeers` ([Extensions](#extensions)). Allow the Helm test pod
(`app.kubernetes.io/component: test`) as an ingress peer, and Prometheus when the
ServiceMonitor is on. `/metrics` shares the HTTP port, so in the proxy modes a scrape peer
also reaches the port the identity layer guards. The chart never adds a Prometheus peer, so decide
whether to admit Prometheus there.

With `restrictEgress: true` an empty `egress` list denies all egress. List these
destinations in `egress`:

- DNS
- PostgreSQL
- Temporal
- Dex
- trusted JWT issuer JWKS URLs
- in `teleport` mode, the Teleport JWKS URL: `auth.teleport.jwksUrl`, or
  `https://<issuer>/.well-known/jwks.json` when it is unset
- telemetry
- module targets

## Database migrations

Each install needs exactly one schema migrator, and `database.migrateOnStartup` chooses it:

| Value | Who migrates | NRO at startup |
| --- | --- | --- |
| `false` (default) | The bootstrap chart's migration Job, installed first | Checks the schema version and exits while the schema is behind (`MAESTRO_DISABLE_STARTUP_SCHEMA_MIGRATIONS=true`) |
| `true` | NRO | Applies pending migrations before it opens its port (`MAESTRO_DISABLE_STARTUP_SCHEMA_MIGRATIONS=false`) |

Set `true` only for an install that does not run the bootstrap migration Job. If you
still install the bootstrap chart for its Temporal Job, set `migrations.enabled: false`
there. With `true`:

- NRO migrates with the connection string in `database.existingSecret`, so that user
  needs schema-management privileges and keeps them while NRO serves. The bootstrap
  chart can give its Job a separate credential (`migrations.existingSecret`); startup
  migrations cannot.
- Replicas that start together wait on a PostgreSQL session advisory lock, so each
  migration runs once. Session locks do not work through a pooler in transaction mode;
  connect directly or through a session-mode pooler.
- The startup probe fails until migrations finish. A migration that outlasts
  `probes.startup` (300 seconds by default) restarts the container mid-migration, so
  raise `probes.startup.failureThreshold` before an upgrade with long migrations.
- With the default `Recreate` strategy, old pods stop before new pods migrate. With
  `RollingUpdate`, old pods keep serving against the schema the new pods are changing.

The Helmfile stack always runs the bootstrap migration Job and rejects this key in the
`remediation-orchestrator` passthrough.

## Null overrides

Helm deletes a key set to `null` in a later values file instead of restoring the chart
default. The schema therefore requires every key that has a default, at every level, and
a null override fails with `at '/path': missing property 'key'`. Remove the override
instead. Schema validation is required; `--skip-schema-validation` is unsupported.

Null is allowed only in these places:

| Key | Why null is allowed |
| --- | --- |
| `nameOverride`, `fullnameOverride` | Null means no override, like the empty default. |
| `podAnnotations` | Null adds no annotations, like `{}`; the render does not change. |
| `extensions` | Null means no contributions. |
| `podDisruptionBudget.minAvailable` | Null selects `maxUnavailable` instead. |
| `podDisruptionBudget.maxUnavailable` | Null selects `minAvailable` instead. |
| Entries of free-form maps such as `resources` and the label maps | Null removes one default entry; for example `resources.limits: null` drops the default memory limit. |

## Endpoints without authentication

NRO serves these paths without a login in every authentication mode. The Ingress (`/`,
`Prefix`) and the HTTPRoute (`PathPrefix /`) route every path to the Service, so they are
public wherever NRO is exposed. Path-level restriction belongs to the Gateway or the ingress
controller, not to this chart. With `temporal.uiProxy.enabled`, both send traffic to
nginx. nginx blocks `/metrics` and `/internal/`; its catch-all route forwards other
paths outside `/temporal/` to NRO. In nvproxy and teleport
modes the chart renders neither, and the paths are reachable wherever the proxy or Teleport
forwards them; restrict them there. In oidcProxy mode the proxy's policy applies to them
too, unless it exempts them.

| Path | What it reveals | Reached through | How to restrict it today |
| --- | --- | --- | --- |
| `/metrics` | Every application metric in Prometheus text format, Go runtime and process metrics, `target_info` with the environment ID, NRO version and pod name, and `maestro_tenant_info` with each active tenant's ID, display name, datacenter and CSP (cloud service provider) | Ingress or HTTPRoute without the proxy. The proxy answers 404 for it. | Enable the proxy, or use path rules at the Gateway or ingress controller (below) |
| `/status` | JSON with `ok` or `degraded` and one `ok` or `failed` per database and Temporal check, with HTTP 503 when degraded; no error details. A request can run database lock checks; results are cached for 10 seconds. | Ingress or HTTPRoute, with or without the proxy | Path rules at the Gateway or ingress controller (below) |
| `/healthz`, `/readyz` | The text `OK`, which shows only that the process serves HTTP | Ingress or HTTPRoute, with or without the proxy | Path rules at the Gateway or ingress controller (below) |

In-cluster callers such as probes and `helm test` reach the NRO pod or Service directly, so
blocking these paths at the edge does not affect them.

- HTTPRoute: the chart routes `PathPrefix /` only. At the Gateway, attach a second
  HTTPRoute, outside this chart, for the same hostname with `Exact` matches on these paths
  and send them where you choose; Gateway API gives an `Exact` match precedence over
  `PathPrefix /`.
- Ingress: the chart routes `/` only, and a standard Ingress cannot exclude a path. Use the
  proxy, or your controller's own path rules through `ingress.annotations`.
- NetworkPolicy filters by source and port, not by path. `networkPolicy.ingressPeers` keeps
  other pods off port 6787 but does not stop the ingress controller or Gateway from
  forwarding these paths.

## Offline validation

No cluster is needed. From `helm/`, `bazel test //:remediation_orchestrator_chart_test`
runs this chart's suite, `ci/test.py`, with the pinned tools
([validation guide](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/helm/VALIDATION.md)).
By hand, render with `helm template` and pass optional kinds by exact group/version/Kind,
such as `--api-versions monitoring.coreos.com/v1/ServiceMonitor` or
`gateway.networking.k8s.io/v1/HTTPRoute`. With Helm 4.0.0, also pass a `--kube-version`
([Requirements](#requirements)). `helm lint` does not stop on the chart's validation
failures, so rely on `helm template` for fail-closed checks.

## Versions

The chart's `version` tracks changes to the chart, independently of NRO. The source chart
sets no `appVersion`, because it names no image. The deployed image is always set through
`image.tag` or `image.digest`. Packages that Bazel builds with the NRO image add both:
the release or digest `version`, and an `appVersion` equal to the tag that the bundle's publish
target pushes the image under by default
([nro_helm_package](https://github.com/dsx-ai-factory/remediation-orchestrator/blob/1785e695a8bff76c910115b3c96398a5a59a7183/helm/docs/reference/bazel-rules.md#nro_helm_package)).