Bootstrap chart
Bootstrap means preparing dependencies before you install or upgrade the NVIDIA
Remediation Orchestrator (NRO) server. By default, this chart creates two finite,
ordinary Kubernetes Jobs. One runs /bin/maestro migrate using your NRO image to apply
changes to NRO’s database schema. The other creates or verifies the Temporal namespace
and search attributes that NRO uses to organize and find workflow executions.
It installs no databases, Temporal server, Kubernetes roles, or Helm hooks. All resources live in the Helm release namespace. The ServiceAccount and Pods disable Kubernetes API token mounting.
By default, each Job waits for its dependency within a bounded deadline, even without
Helmfile (Readiness). readiness.enabled: false removes the migration Job’s
PostgreSQL wait. To make Helm wait for the Jobs to complete, use --wait --wait-for-jobs.
For Helmfile’s coordinated installation, follow a quick start. Helmfile can also use existing backing services. To manage the charts separately with plain Helm, prepare PostgreSQL and Temporal, install this chart, then install the NRO chart. The glossary defines terms such as DSN and pgx, and validation covers the repository checks.
In the Helmfile stack, this chart is the nro-bootstrap release
(release graph). It runs after the managed databases and
nro-temporal, whose schema hook has migrated the Temporal stores, and before the NRO
release.
Requirements
This chart supports the same Helm versions as the NRO chart it prepares for. Repository checks use the pinned 4.3.0 by default, and the chart suite also runs with the pinned 3.19.4. The validation limits describe the tested versions.
Chart.yaml cannot express a Helm version constraint, so check helm version before
installing. Helm 4.0.0’s helm template renders with Kubernetes 1.20 capabilities by
default and rejects the chart’s 1.21 floor. With Helm 4.0.0, pass --kube-version 1.21.0
or later. The stack’s support matrix
covers the whole stack, which needs a newer cluster.
Install
Prepare these before installing:
- The Kubernetes namespace, which
helm upgrade --installdoes not create, and in it every Secret your values reference (Database connection). - The databases, their connection Secrets, and Temporal’s own server schemas. This chart never performs Temporal server schema migrations.
- With the default
verifymode, the registered Temporal namespace and the five Keyword search attributes in Temporal prerequisites. A missing namespace makes the bootstrap Temporal Job retry until its deadline and then fail. Missing search attributes fail the prerequisite check. On a fresh Temporal service, an owner with namespace-registration and search-attribute creation permissions can selectmanagemode instead.
These values keep the default temporal.auth.mode: none, which connects over plaintext
gRPC without credentials. For a Temporal service that requires TLS or authentication,
add an apiKey or mtls block from Temporal authentication.
Save these values as bootstrap-values.yaml and replace the placeholders. They use the
same image reference and connection interface as the NRO chart:
A Helm rollback cannot undo data migrations or Temporal history changes, and this chart never runs down migrations. In your delivery controller, run only one bootstrap at a time against the same database. Before an incompatible schema upgrade, stop old NRO workers and take backups.
Check ownership before you run the command below. If the Helmfile stack already manages
nro-bootstrap in this namespace, the command upgrades that release with only
bootstrap-values.yaml and the chart defaults. That can change its Jobs, image and
connection settings. Those values remain until you run Helmfile sync again with the
installation’s original environment, context, state files and overrides. For a
Helmfile-managed installation, change its state file instead.
Then select the intended cluster (Select the cluster) and install from the Helm module root:
Any release name works. The resources’ base name is the release name followed by the
chart name, unless the release name already contains the chart name. The base name is
truncated to 40 characters to keep Job names within 63 characters. The release
nro-bootstrap therefore gives the base name nro-bootstrap-remediation-orchestrator-b
and Jobs such as nro-bootstrap-remediation-orchestrator-b-migrate-<hash>.
The Helmfile installs this chart as nro-bootstrap and sets fullnameOverride to that
release name. Its Jobs are therefore nro-bootstrap-migrate-<hash> and
nro-bootstrap-temporal-<hash>. For the same names with plain Helm, add
--set fullnameOverride=nro-bootstrap.
For its managed Temporal server, the Helmfile sets temporal.management: manage. For
an external one, it copies the state key temporal.management. It also
sets temporal.job.enabled from the state key temporal.bootstrapJob; see
Dependency and wiring.
Deploy NRO only after this operation succeeds, following
Install with plain Helm.
Keep the NRO chart default database.migrateOnStartup: false; refer to
Database migrations.
Database connection
The database Secret contains a full PostgreSQL connection string, including the TLS
parameters your database requires. Chart values and rendered manifests hold the Secret
reference, and the pod reads the connection string itself. In a URI-form connection
string, put the password in the userinfo part, not in a ?password= query parameter,
because the migration Job can log that form in clear text
(PostgreSQL wait).
Every Secret, pull Secret and ServiceAccount named here must be a resource in the
release namespace. As in the NRO chart, names use lowercase letters, digits, - and
.. The schema rejects anything else, including a namespace/name reference. Secrets
mounted through migrations.extraVolumes pass through unchecked. Secret keys such as
connectionStringKey take letters, digits, -, _ and ..
migrations.existingSecret and migrations.connectionStringKey optionally
select a separate DSN with schema management privileges. Otherwise the
migration uses database.
For PostgreSQL servers that need private trust roots or client certificates,
mount existing Secrets through migrations.extraVolumes and
migrations.extraVolumeMounts, then reference the files in the Secret’s DSN:
For example, the DSN can include sslmode=verify-full,
sslrootcert=/database-tls/ca.crt, sslcert=/database-tls/tls.crt, and
sslkey=/database-tls/tls.key. Configure equivalent NRO extraVolumes
and extraVolumeMounts if its DSN uses these same paths.
These bootstrap settings apply only to the migration Job, including its wait-postgres
init container, which receives the same mounts. Kubernetes volume and mount fields
pass through as supplied.
Volume names tmp and temporal-tls are reserved. Mounts cannot overlap /tmp,
/temporal-tls, /bin/maestro, or /bin/database-ready, including parent paths
such as /bin. Duplicate volume names, duplicate normalized mount paths, and
mounts referring to unknown volume names fail rendering.
Changes to volumes, mounts, or their Secret references change the migration Job
name. The bootstrap Temporal Job remains unchanged.
Readiness
The migration Job has one init container that waits for PostgreSQL. It is enabled by
default with readiness.enabled: true. The bootstrap Temporal Job has no init container.
Its script retries every Temporal command until readiness.timeoutSeconds expires
(Deadlines and render checks).
readiness.enabled does not affect the bootstrap Temporal Job.
Temporal prerequisites describes its retry and timeout
behavior.
With a managed database, the Helmfile runs a presync gate before this release. A presync gate is a check that runs before a release is synced, and this one waits for the NRO database. The gate gives earlier feedback, but the chart does not depend on it for correctness. With an external database, this release has no gate.
PostgreSQL wait
wait-postgres uses the same image, pull policy and securityContext as
migration. The NRO image includes the standalone /bin/database-ready binary,
built with the application’s pgx dependency. Before deploying this chart, confirm
that /bin/database-ready accepts --wait-seconds, --interval-seconds and
--timeout-seconds. A missing binary causes a container start error, and an older
binary rejects the new flags. In either case, rebuild the NRO image. The binary reads
MAESTRO_DB_CONNECTION_STRING from the same Secret and key as migration, so
migrations.existingSecret applies to both. The shared
migrations.extraVolumes mounts make TLS files available at the same paths.
The init container runs /bin/database-ready --wait-seconds N --interval-seconds N --timeout-seconds N directly. The command owns the bounded retry loop and uses
pgx.ParseConfig, matching maestro migrate. Each attempt opens
an authenticated connection and requires SELECT 1 to return 1. URI and
keyword connection strings reach pgx unchanged, including runtime parameters
such as statement_timeout and pgx client settings. An empty or unparsable
connection string, or a TLS file it names that cannot be read, fails immediately
with a configuration message naming the Secret. A server that rejects the
credentials, database or TLS handshake keeps the Job waiting until its deadline.
Success prints PostgreSQL authenticated SELECT 1 ready.
Each attempt is limited to readiness.attemptTimeoutSeconds (default 10),
capped by the remaining readiness deadline. The command bounds connection and
query execution with a context deadline. It does not replace the connection
string’s PostgreSQL settings. The probe makes no schema changes.
The connection string stays in the environment and never appears in command arguments. The probe never prints the connection string or database driver errors. It suppresses individual probe errors and, on deadline expiry, reports only readiness status and the Secret identity.
The migration Job is different, because maestro migrate logs database driver errors. A
URI-form connection string that carries the password as a ?password= query parameter
appears in clear text in a parse error. Put the password in the userinfo part of the URI
instead.
The wait-postgres init container uses fixed small resources (requests of 10m CPU and
32Mi memory, and a 128Mi memory limit). It shares the chart’s securityContext: nonroot,
read-only root filesystem, no privilege escalation, and dropped capabilities. A writable
/tmp is mounted.
Deadlines and render checks
Every wait is bounded. readiness.timeoutSeconds (default 300) is the
deadline for wait-postgres. It is also the bootstrap Temporal Job’s whole retry
budget, counted from when its script starts. readiness.intervalSeconds (default 3)
is the pause between probes and between Temporal retries. Each Temporal command and its
connection are limited to temporal.commandTimeoutSeconds (default 20). A command
already running at the deadline can therefore finish up to that much later.
When the deadline passes, the container prints a clear message to stderr and exits 1.
The Job then fails, and the pod is not retried unless jobs.backoffLimit allows it.
Each Job’s jobs.activeDeadlineSeconds (default 600) still caps the whole
Job, including the init container. Reserve time for the migration itself with
readiness.migrationHeadroomSeconds (default 60). When both the migration Job
and readiness are enabled, rendering fails unless:
timeoutSeconds + migrationHeadroomSeconds < jobs.activeDeadlineSecondsattemptTimeoutSeconds <= timeoutSecondsintervalSeconds <= timeoutSeconds
While the bootstrap Temporal Job is enabled, whatever readiness.enabled says, rendering fails
unless timeoutSeconds + temporal.commandTimeoutSeconds < jobs.activeDeadlineSeconds.
These constraints reserve time for the migration and the last Temporal command, and let
each container report its own message before the Job ends with a generic
DeadlineExceeded. Keep them satisfied if you change any of these values.
Job renames
Set readiness.enabled: false to remove the init container. It is part of the
migration Job spec, so toggling this value or changing attemptTimeoutSeconds renames
only the migration Job. Changing readiness.timeoutSeconds or intervalSeconds renames
the bootstrap Temporal Job, and the migration Job while its init container is rendered.
readiness.migrationHeadroomSeconds is checked at render only and renames no Job.
Temporal prerequisites
temporal.management (default verify) selects what the bootstrap Temporal Job does.
Both modes require a registered namespace in which these five attributes have type
Keyword:
verify describes the namespace and lists its search attributes. It never changes
Temporal. manage first runs temporal operator namespace create with
temporal.namespaceRetention (default 72h) and accepts the CLI’s already exists
answer. It then creates all five attributes in one
temporal operator search-attribute create call and runs the same checks as verify.
It never changes an existing namespace’s retention. The CLI checks every requested
attribute’s existing type before adding any, so a type conflict creates nothing.
Verify mode needs permission to describe the namespace and list search attributes. Manage mode also needs permission to register the namespace and add search attributes.
The Temporal prerequisite script retries every failed
CLI command until the retry budget in
Deadlines and render checks runs out. The retries cover
a frontend that is still starting. They also cover a wrong address or credential, which
therefore costs the whole budget before the Job fails. When the budget runs out, the
Job fails with Timed out during <phase> for namespace <ns> at <address>; last error:
followed by the last CLI output. When no further command could start, that last
output is Time budget exhausted before <command>.
These failures are immediate:
Success prints Namespace <ns> is registered with all five Keyword search attributes (<mode>). The entire Job is capped by jobs.activeDeadlineSeconds (600 by default).
jobs.backoffLimit defaults to zero in this chart, so an initial failure stays available
for inspection. The Helmfile sets it to 1 (state key bootstrap.jobs.backoffLimit), so
under Helmfile a failed pod is retried once before the Job fails.
Turning the Temporal Job off
temporal.job.enabled (default true) controls whether the bootstrap Temporal Job is created.
Disable it for an external Temporal service where a platform team prepares the namespace
and search attributes. This is typical of a shared or hosted service that gives NRO a
namespace without access to the operator APIs the Job calls. Even verify mode needs
temporal operator namespace describe and temporal operator search-attribute list.
With the Job off:
- The bootstrap Temporal Job is not rendered, the same way
migrations.enabled: falseremoves the migration Job. The migration Job and itswait-postgresinit container are unchanged. temporal.address,temporal.namespaceand thetemporal.authcredentials are no longer required, and the auth consistency rules do not run, because nothing reads them. The schema still checks their types and enums.temporal.management: manageis rejected, because nothing would create a missing namespace or search attribute. Keep it atverify, the default.- Nothing in this release checks Temporal connectivity or authentication. Before NRO starts, the platform team must have registered the namespace and created all five Keyword search attributes listed above.
Keep the Job on when this chart can reach the frontend and its identity can describe the
namespace and list search attributes. In verify mode, the Job catches a missing
namespace or a wrong attribute type before NRO starts.
Under Helmfile the state key temporal.bootstrapJob sets this value; see the
state table.
Temporal authentication
The same address, namespace, and authentication mode apply to every CLI request. Credentials may differ from NRO when bootstrap needs administration permissions.
The Job passes TLS settings and the API key to the Temporal CLI through environment
variables, never command arguments: TEMPORAL_TLS, TEMPORAL_API_KEY in API-key mode, and
for mTLS
TEMPORAL_TLS_CLIENT_CERT_PATH, TEMPORAL_TLS_CLIENT_KEY_PATH, the optional
TEMPORAL_TLS_SERVER_CA_CERT_PATH and TEMPORAL_TLS_SERVER_NAME. The address, namespace
and timeouts are command arguments. The script passes --disable-config-file, so no CLI
configuration file in the image applies.
none uses plaintext gRPC (TEMPORAL_TLS=false). API-key mode enables verified server
TLS and reads the key from the Secret into TEMPORAL_API_KEY:
mTLS mounts an existing Secret read-only at /temporal-tls and enables hostname
verification:
While the bootstrap Temporal Job is enabled, template validation rejects credential
settings that conflict with temporal.auth.mode. The schema checks only their types,
patterns and the mode enum.
CLI errors appear in the Job log. They never contain the API key, but a TLS error can
name a certificate file such as /temporal-tls/client.crt.
Images
The default digest identifies the multiarchitecture (amd64 and arm64)
temporalio/admin-tools:1.32.0 image, which ships Temporal CLI 1.9.0 and no Python.
An override must provide /bin/sh, awk, date, sleep and a temporal CLI on
PATH whose -o json output and error texts match the 1.9.x releases: the script
reads the namespace state and attribute types from the pretty-printed JSON and matches
already exists and has different type in errors. Use the admin-tools image from the
same Temporal release as the server, and run the
runtime image checks against it before
deploying it.
Set exactly one of tag or digest. With a digest, clear tag.
Helmfile uses upstreamImages.temporalAdminTools or the tag in
helmfile/locks/upstream.lock.json, shared with the managed Temporal chart. This
Helmfile default uses a version tag, not the standalone chart’s digest pin. With external
Temporal, a digest override is supported. With managed Temporal, this stack supports only
tagged overrides.
PostgreSQL readiness uses only the NRO application image, whose /bin/database-ready
must support the retry flags in PostgreSQL wait.
Temporal prerequisite script
files/temporal-prerequisites.sh is the bootstrap Temporal Job’s whole program. Helm
reads it with .Files.Get and passes it inline to /bin/sh -c, so no ConfigMap or
image build is involved. The script has no defaults. The Job sets MODE,
TEMPORAL_ADDRESS, TEMPORAL_NAMESPACE, NAMESPACE_RETENTION, TIMEOUT_SECONDS,
INTERVAL_SECONDS and COMMAND_TIMEOUT_SECONDS from the chart values. The script
exits before any CLI call when one is missing. The script is part of the Job spec and
therefore of the Job name hash. Editing it renames the bootstrap Temporal Job and leaves the
migration Job unchanged.
Rerun the Jobs
A completed Job does not run again while its input is unchanged. To retry after changing
a Secret’s contents behind an unchanged name, or to rerun migration or verification on
purpose, change runToken. Secret reference changes produce new Jobs automatically.
This works because each Job name ends with a deterministic hash, the first characters of
a SHA-256 digest. The hash
covers the normalized rendered Job spec plus explicit metadata inputs: labels,
annotations, namespace, ServiceAccount inputs and runToken. The spec includes task
commands, image references and readiness init containers. The inline Temporal script is
part of the Temporal spec, so a script change produces a new Job without an image
rebuild.
Changes to the image, command, target, Secret references, resources, scheduling, security or readiness produce new names. The hash uses no timestamps, random values, secret contents or circular name hashes.
Completed and failed Jobs have no TTL and remain for reconciliation and diagnosis. An upgrade can prune old release-owned Jobs when their names change.
By default, uninstalling this chart deletes its Jobs and ServiceAccount. It does not delete external Secrets, databases, namespaces, or search attributes.
Security
Both Jobs default to a nonroot UID/GID, RuntimeDefault seccomp, dropped Linux
capabilities, no privilege escalation, and a read-only root filesystem with a
writable /tmp. Test image overrides against these settings.
Kubernetes placement and security maps and resources are configurable.
imagePullSecrets applies to both Jobs and the init container. To use an existing
ServiceAccount, set serviceAccount.create: false with an explicit name. This chart
grants no Kubernetes permissions.
NetworkPolicies installed elsewhere must allow DNS and each Job’s PostgreSQL and Temporal connections, including those of the init container.
Offline checks
Run the suite from the Helm module root:
To check by hand, run these commands from the Helm module root with Helm 3.19.4 or
later (Requirements). Lint the chart, and also render it with the same
values. helm template evaluates every template check, so use its exit status for
fail-closed validation.
Before changing adminTools.image or the script, run the
runtime image checks. bazel test does not
run them.
The tests check positive and
negative renders, Secret and auth shapes, complete spec hash changes, and
ordinary Job ownership. They also run helm lint --strict, package the chart
(.helmignore keeps tests/ and ci/ out) and check that the longest release name
still gives Job names of at most 63 characters.
They run the Temporal prerequisite script against a scripted fake CLI, covering both
modes, credential environment, type conflicts, retry budgets, deadlines and
idempotence. This suite checks the PostgreSQL command wiring. The application’s Go
tests in internal/postgresready and cmd/database-ready cover unchanged DSNs,
authenticated results, retries, deadlines and secret-free diagnostics.
The tests do not replace live database migrations or live API-key and mTLS
handshakes against your services. bazel test //... runs this suite together with
every other offline check.