Shared K8s
This guide installs the stack on an existing Kubernetes cluster with authentication and a public URL. NRO and its managed backing services run in a namespace you choose. Managed backing services are the PostgreSQL, Temporal and telemetry services this stack installs.
Users open your HTTPS publicUrl and sign in through your existing Dex, an OpenID
Connect identity provider. Members of your administrator group have administrator
access.
This guide uses dev, the supplied example environment for a shared cluster. It assumes
you already have Dex, an ingress controller, a DNS record and a TLS Secret. dev is a
starting point and is not production-ready on its own: configure backups, availability
and capacity for your environment.
Where you can choose differently, the step links to the alternative: an authenticating proxy or Teleport in place of Dex, or PostgreSQL, Temporal and a collector you already run.
Before you start
You need a checkout containing this Helm module. If you do not have one, follow Get the checkout, then return to this guide from the Helm module root.
Run the commands from the Helm module root, which contains helmfile/. In a clone of
https://github.com/dsx-ai-factory/remediation-orchestrator.git, this is the helm/
directory. Only the optional image build runs elsewhere, and its step tells you when to
leave and when to return.
Keep the same shell session through image preparation and deployment so the directory and namespace variables remain available.
Replace example.org, example.invalid and values in capitals, such as CONTEXT and
DEX_CLIENT_SECRET_FILE, with your own. Replace the lowercase example names as well: the
namespace remediation-orchestrator-dev, the ingress class nginx, the TLS Secret
remediation-orchestrator-tls and the pull Secret registry-credentials.
A few of these needs have more detail:
- Tools: Helm 4 also works, kubectl must be within one minor version of your API server,
and curl is only for the optional
/statuscheck (Tools and compatibility). The image build also needs the application source checkout’s build prerequisites. Bazel is the image build tool. - Cluster access: the presync gates are scripts Helmfile runs before it installs or
upgrades a release (glossary). The database presync
gate needs
pods/execin the target namespace. The CNPG operator gate reads CustomResourceDefinitions and webhook configurations cluster-wide. It also reads the operator Deployment and Endpoints incnpg.operatorNamespace, even whencnpg.installisfalse. Security posture lists every permission the gates use. Installing the operator needs permission to create cluster-wide resources. - Storage: not needed when both
database.modeandtemporal.modeareexternal(Use existing backing services). - Registry: the cluster must also pull the
pinned upstream images from
ghcr.ioand Docker Hub, and thehelm testimagecurlimages/curl:8.21.0from Docker Hub. Otherwise, set mirrors throughupstreamImages,cnpg.expectedImage,postgresql.imageandremediation-orchestrator.tests.image.
The stack does not create the cluster, the registry, Dex, a proxy, the ingress controller, DNS or certificates.
1. Select the cluster
The state file does not name a cluster. dev uses the current kubectl context unless you
pass --kube-context or set HELMFILE_KUBE_CONTEXT. Select the cluster once and clear
those overrides, so Helmfile, Helm and kubectl agree:
use-context writes your kubeconfig file, so other terminals using that file also switch
to this cluster. To use another kubeconfig file, export KUBECONFIG=/path/to/config in
every terminal you use, before selecting the context. Check
kubectl config current-context before each sync or destroy
(Select the cluster).
2. Prepare the image and identity
Image
This module supplies no published NRO image. If a compatible image is already in a
registry your cluster can reach, note its repository and tag or digest for step 4 and
skip to Dex sign-in. A compatible image contains /bin/maestro, the UI
assets and a /bin/database-ready probe that accepts the --timeout-seconds,
--wait-seconds and --interval-seconds flags bootstrap passes.
Otherwise, build and push one. First record the Helm module root so you can return to
it. Then change to the application source root, which contains cmd/maestro/. In a
public clone, this is the parent directory:
From the application source root, sign in to your registry and push a Linux amd64 and arm64 image. Always supply your own repository and an explicit tag:
The push also writes the generated tags 0.0.0 and commit. Every push overwrites them,
so deploy your explicit tag. The build needs C/C++ toolchains for both Linux
architectures. Build and publish images
covers toolchains, other source layouts and tag stamping.
Return to the Helm module root, where every remaining command runs:
Dex sign-in
NRO signs users in through your existing Dex. Choose the HTTPS origin users will open,
such as https://remediation-orchestrator.example.org, as your publicUrl. Then, in Dex:
- Register the client
remediation-orchestratorwith redirect URI<publicUrl>/auth/callback, for examplehttps://remediation-orchestrator.example.org/auth/callback. Save its client secret in a file for step 3. - Set Dex’s issuer to
<publicUrl>/auth/dex. NRO proxies Dex at/auth/dex, so the supplied routing needs this issuer. A custom issuer path needs separate proxy routing (dex). - Set the environment variable
DEX_API_CONNECTORS_CRUD=trueon the Dex server and configure at least one connector. The NRO login page lists connectors through Dex’s gRPC API. - Keep Dex’s plaintext gRPC port on a protected network.
Record two addresses for step 4: Dex’s root URL as seen from NRO pods, such as
http://dex.identity.svc:5556, and Dex’s working gRPC address, such as
dex.identity.svc:5557.
To use an authenticating proxy or Teleport instead, follow Authenticate through a proxy or Teleport and change these steps:
- In step 3, skip the Dex client Secret.
- In step 4, skip the
auth.dex.*rows and replace the example’s wholeauthblock, includingdex:, with the one from that page. - In step 4, also skip the Ingress and keep
remediation-orchestrator.ingress.enabledfalse. The chart rejects an Ingress in these modes. - In step 4, also add the
remediation-orchestrator.networkPolicyblock from that page, withingressPeersfor your proxy or Teleport agent pods and thehelm testpeer. - In step 5, skip enabling the Ingress, and sign in through your proxy or Teleport.
3. Create the namespace and Secrets
Choose the Kubernetes namespace for this installation and record it once. Every later
command uses it, and the state file’s namespace must hold the same value:
The commands read credentials from files, which keeps them out of command arguments and shell history. Keep them out of state files and Git as well. Prefer delivering the Secrets to the cluster through your secret manager. Otherwise, keep each file outside the checkout and readable only by you.
DEX_CLIENT_SECRET_FILE holds only the client secret registered in Dex, with no trailing
newline. In a proxy mode, skip the Dex Secret.
For a private registry, also create a pull Secret from a Docker config.json whose
auths entry for your registry holds the credentials. A file that only names a
credential helper does not work:
REGISTRY_CONFIG_JSON is the path to that config.json file.
State files hold Secret names, never their contents.
4. Write your state file
A state file is a YAML configuration file for one installation. Helmfile uses it to set the namespace, image, authentication and backing-service choices.
Copy the example to where you manage deployment configuration, outside version control:
Never save the copy directly in helmfile/, because directory-form -f ./helmfile
loads every YAML file there as a Helmfile. Helmfile resolves a relative
--state-values-file from helmfile/, not from your shell, so the commands below pass
a quoted absolute path
(Where to keep your state file).
Open the copy in an editor and set every key below. The render fails while any
REPLACE_ME value remains, and reports only the first one it finds. The message comes
at the end of a long template trace, after error calling fail:.
Validation messages explains how
to read it.
The example’s other values, such as the candidate tag, the dex.identity.svc
addresses and the administrator group, pass the checks but are placeholders too. The
command below lists the remaining example values. It matches neither datacenter nor
temporal.namespace, so set those two from the table:
Set these keys:
For a private registry, reference the pull Secret from step 3, so the bootstrap Jobs and NRO can pull the image:
Expose NRO
Setting publicUrl does not expose NRO, because the chart’s Service is ClusterIP and no
route is enabled by default. You publish NRO at the publicUrl origin yourself. The
remediation-orchestrator passthrough is the state map the stack passes to the NRO chart
as values. In dex mode, with your existing ingress controller, add an Ingress through it:
In the proxy and Teleport modes, keep remediation-orchestrator.ingress.enabled: false
and skip this Ingress, because the identity layer is the entry point
(Authenticate through a proxy or Teleport).
Set className to your controller’s class. The TLS Secret must already exist in
$nro_namespace, and DNS for the publicUrl host must point to your ingress controller.
This Ingress routes every path, so /metrics, /status, /healthz and /readyz are
reachable without login. Restrict them at the controller, or accept that exposure
deliberately
(Endpoints without authentication).
Step 5 offers an optional private /status check through a port-forward. To run it
before public exposure, set remediation-orchestrator.ingress.enabled: false for the
first render and sync, and enable the Ingress after the check passes.
For a Gateway API route or another exposure, configure it through the same passthrough
(NRO chart values) or in front of
the Service. Whatever you use must serve the same HTTPS origin as publicUrl for
browser login to work.
State keys explains every key, and the other configuration pages cover existing PostgreSQL, Temporal or collectors and chart tuning.
5. Render, deploy and verify
Render first. This contacts no cluster:
Run sync only after the render succeeds. Check the template command’s exit status,
not the file, because a failed template still writes the other releases to the file.
Then review the successful output.
A clean render matters because sync renders each chart only when it reaches that
release, and the remediation-orchestrator release comes last. An error that only the NRO
chart detects, such as an authentication rule or invalid TOML, would therefore stop
sync after the databases, Temporal and the bootstrap migration were applied.
Helmfile installs the pinned chart versions but does not check the archive checksums in
the lock file. Only the Bazel tests check them
(Version pinning). To check the archives against the
lock, run bazel test //... in the Helm module root on the revision you deploy. That
check needs Bazel (Prerequisites).
sync and destroy change the cluster. Run them only on a cluster you are authorized
to change.
When you are ready, deploy and check the installation. Run these commands in the
terminal from step 3, where nro_namespace is set. In a new terminal, first set
nro_namespace to the exact namespace value in your state file, and confirm the
context with kubectl config current-context.
Expect the NRO pod and the PostgreSQL, Temporal and collector pods the stack manages to be
Running and ready. Two initialization Jobs should be complete, and their pods show
Completed:
With managed Temporal, a third Job, nro-temporal-schema, creates or updates the Temporal
server’s database schemas as a Helm hook before the Temporal servers start. Helm deletes
it on success, so a successful sync does not list it. A failed one stays for inspection
(Temporal schema migration).
With an external Temporal server there is no schema Job. Setting
temporal.bootstrapJob: false for that server, which is allowed only with
temporal.management: verify, also omits the bootstrap Temporal Job. The migration Job
always runs.
Managed Temporal pods can restart during the first install while the servers initialize. That is expected, so a nonzero restart count alone is not a failure. If pods keep restarting, stay unready or pending, or a Job fails, refer to Troubleshooting.
The Helm test requests NRO’s /status and passes when it returns a successful HTTP
status. NRO answers 503 when its PostgreSQL or Temporal check fails.
You can also check /status through a port-forward, without the Ingress. Forward the
port in one terminal and request it from another:
If you left the Ingress disabled for this check, set enabled: true after it passes.
Then render and sync again with the same commands before you open publicUrl.
Finally, open your publicUrl, or your Teleport app, and sign in. Check that your group
claims grant the intended administrator access. To do that, open /auth/profile on the
same address. The page shows your user, and the badge Role: Site Admin for a member of
auth.siteAdminGroups. If a step fails, start with
Troubleshooting.
The charts load no user scripts. NRO’s internal indexing workflows, script-indexer and
temporal-workflow-indexer, start on their own with minute-based schedules by default,
so they can appear in Temporal before you add a script.
Next steps
Follow Your First Script to write, register and run your first script through the UI. To deliver scripts to this installation afterwards, follow Deploy workflow scripts.
- Add another installation: Add your own environment.
- Upgrade the deployment or remove the stack: Upgrade and Uninstall.
- Something failed: Troubleshooting.