Local K8s
This guide installs the whole stack on a Kubernetes cluster on your machine, with
authentication disabled. At the end, NRO, PostgreSQL, Temporal and the telemetry
collector run in the remediation-orchestrator namespace, and you can open the NRO web
UI at http://localhost:6787.
The commands use kind, which runs local Kubernetes nodes in Docker containers and is the
cluster tool the supplied local environment targets. To use k3d, minikube or another
local cluster instead, read
Use another local cluster before you run the kind commands.
The local environment disables authentication and installs CloudNativePG (CNPG), the
cluster-wide operator that manages the PostgreSQL databases. Use it only on an isolated,
disposable cluster. For a cluster other people use, follow Shared K8s.
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.
You need these tools on PATH:
- Python 3.12 or later, Helm 3.19.4 or later (including Helm 4) and Helmfile 1.8.1.
- kubectl within one minor version of your cluster’s API server.
- Docker, with its daemon running, and kind, for the supplied kind example.
- Bazel, the build tool used to create the NRO image, and the application source checkout’s build prerequisites. Skip them if you already have a compatible image.
kind/config.yaml pins no node image, so the cluster runs your kind release’s default
Kubernetes version. The CNPG operator needs 1.29 or later
(support matrix), so use a kind release whose
default meets it. After you create the cluster, kubectl version shows the server’s
version.
Tools and compatibility explains how to install these tools with checksum verification and lists the versions the tests cover.
Commands run in two directories. Helmfile commands run 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. The image build runs from the application source root, which contains
cmd/maestro/; in a clone, this is the clone root. Each command block below names its
directory.
Helmfile uses your own Helm configuration and cache. The first preview downloads the pinned upstream charts, and the first install pulls container images, so both need network access.
Build the NRO image
This module supplies no published NRO image, so you build one or use a compatible image
of your own. The local environment runs remediation-orchestrator:local from the kind
nodes and never pulls it. The commands below start from an image in Docker named
maestro:latest.
If you already have a compatible image, skip the build and tag it as maestro:latest,
for example with docker pull and docker tag <your image> maestro:latest.
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. An image built before those flags existed fails at the bootstrap
wait-postgres init container.
Validation messages lists that
failure and its fix.
To build from source, first record the Helm module root so you can return to it. Then change to the application source root, which is the parent directory in a public clone:
Use the same shell session for the build and deployment steps, so nro_helm_dir remains
available when you return from the application source root.
From the application source root, build the image and load it into Docker:
The first build can take several minutes. Then return to the Helm module root for every command that follows:
Build and publish images covers other source layouts, the toolchain each host architecture needs and what the image contains.
Preview without a cluster
From the Helm module root, list the releases and their installation order, then render the manifests. These commands do not change any cluster, so you can check the setup before you create anything. Continue to installation only if the render succeeds:
A zero exit status means the render succeeded. The file then holds every manifest for review.
Create the cluster and install
From the Helm module root, create the cluster, load the image and install the stack. These commands change your Docker images and create Kubernetes resources:
sync installs the releases in dependency order and waits for each one. A step that
cannot finish fails with a message after its deadline. readiness.timeoutSeconds sets
the Helm timeout and the presync gate deadline, 900 seconds by default. The bootstrap
Jobs have shorter deadlines of their own
(Deadlines and render checks).
If sync fails, start with Troubleshooting.
use-context makes the kind cluster the current context in your kubeconfig for the
kubectl and helm commands below. It also changes the cluster that other terminals
using that kubeconfig reach.
Helmfile selects its cluster separately. -e local pins it to
kind-remediation-orchestrator, whatever the current context is. Only --kube-context
or HELMFILE_KUBE_CONTEXT overrides that pin. A shell prepared for another cluster with
HELMFILE_KUBE_CONTEXT set would send the local stack there. The unset clears that
override, and Helm’s, so neither tool reaches another cluster
(Select the cluster).
Check and open NRO
When sync returns, check the pods and Jobs, then run the chart’s health test:
Expect the NRO, PostgreSQL, Temporal and collector pods to be Running and ready. The
two initialization Jobs below should be complete, and their pods show Completed:
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).
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 PostgreSQL and Temporal checks
succeed.
Open the web UI:
The NRO port-forward keeps this terminal occupied. Open http://localhost:6787 in a
browser to reach the NRO web UI.
The port-forward attaches to one NRO pod, even through svc/remediation-orchestrator.
It stops when that pod is replaced, for example after a rebuild or upgrade. Wait for the
new pod to become ready, then rerun the same port-forward command:
To open the Temporal UI, use a second terminal with the same kubeconfig. Run
kubectl -n remediation-orchestrator port-forward svc/nro-temporal-web 8080:8080, then
open http://localhost:8080/namespaces/default/, the base of NRO’s workflow links.
The charts load no user scripts, but NRO starts its internal indexing workflows on its own.
The workflow list can show script-indexer and temporal-workflow-indexer runs before
you add a script. They use minute-based schedules by default. When the first runs appear
depends on startup and scheduling.
Use another local port
If port 6787 is occupied, change both the NRO URL and the forwarded port, and keep the
publicUrl override on later syncs:
After the NRO pod is replaced, rerun this forward with 16787:6787 once the new pod is
ready. Restarting the forward needs no Helmfile sync.
Use another local cluster
The local environment works on any local Kubernetes cluster that meets the
support matrix and can provision volumes through
a default StorageClass. The repository tests and the commands above use kind; the k3d and
minikube commands below follow those tools’ own documentation and are examples, not
tested paths.
-e local pins Helmfile and its presync gates to the kube context
kind-remediation-orchestrator on purpose. The environment installs an unauthenticated
NRO and a cluster-wide operator, and the pin keeps them off a shared cluster that happens
to be your current context. Changing your current kubectl context does not move the pin.
Name the other cluster’s context explicitly, with --kube-context or the
HELMFILE_KUBE_CONTEXT environment variable. When both are set, --kube-context wins.
Complete Build the NRO image and Preview without a cluster as written. Then, from the Helm module root, follow these steps instead of Create the cluster and install:
-
Create the cluster with your tool, for example
k3d cluster create remediation-orchestratororminikube start. Then find its context name withkubectl config get-contexts. k3d names itk3d-<cluster>and minikubeminikube. The commands below usek3d-remediation-orchestrator; substitute your context. -
Make it the current context for the plain
kubectlandhelmcommands, which do not read Helmfile’s selection: -
Place the image on every node. The
localenvironment setsimage.pullPolicy: Never, so the nodes never pullremediation-orchestrator:local. Each node must already hold it. Tag the image, then use your tool’s image import:To pull from a registry the cluster can reach instead, set the image in a state file passed with
--state-values-file, includingimage.pullPolicy: IfNotPresent(State layers). -
Run every Helmfile command for this cluster with the same override, including
status, latersyncruns anddestroy:Or export the override once for this terminal, and unset it before you work with any other cluster:
-
Continue with Check and open NRO; its
kubectlandhelmcommands use the current context you selected in step 2.
The presync gates receive the Helmfile context but read kubeconfig through
KUBECONFIG. If the context lives in a kubeconfig file other than the default, export
KUBECONFIG=/absolute/path/to/config in every terminal you use, including one running a
port-forward. Native Helmfile’s --kubeconfig reaches Helm only, not the gates.
The rebuild and removal commands in this guide and in
Update and remove deployments are written for kind. For
another local cluster, add the same context override to their Helmfile commands. Use
your tool’s image import in place of kind load, and its cluster deletion in place of
kind delete cluster.
Remove the local cluster
When you no longer need the disposable cluster, delete it. This deletes the cluster and every database volume in it, so all NRO and Temporal data is lost:
To keep the cluster and its services, or to remove only some releases, follow Remove the local deployment.
Next steps
- Run your first workflow: Your First Script.
- Test the NRO chart’s
examples/local.yamlwith plain Helm against the dependencies you installed: Try the example on the local stack. - Rebuild after a code change, or remove releases: Update and remove deployments.
- Something failed: Troubleshooting.
- Deploy with authentication on a cluster other people use: Shared K8s.