Air-Gapped Installation

Install Nirmata Control Hub 5.0 on an air-gapped Kubernetes cluster from a private registry

Applies to: Nirmata Control Hub 5.0 and later

This guide installs Nirmata Control Hub (NCH) 5.0 on a Kubernetes cluster that has no access to the internet. Every image is pulled from a private registry, and every pull secret points at that registry.

NCH 5.0 is installed from the nch-charts chart. Compared with NCH 4.x:

  • Service-to-service traffic uses SPIRE mTLS. Every service gets a SPIFFE identity from SPIRE, and haproxy reaches the backends over mTLS. The chart installs SPIRE in its own spire namespace.
  • The database is TimescaleDB, run by the CloudNativePG (CNPG) operator, or an external PostgreSQL database.
  • Kafka runs in KRaft mode, with a separate Kafka controller and no ZooKeeper.
  • Cloud agents (Agent Hub) run as OttoFlow workflows, installed by a fifth Helm release.
  • Common settings are made once under global: the registry, pull secret, storage class, URL and certificate.

Overview

  1. Check the prerequisites.
  2. Download the install files on a connected machine.
  3. Mirror the images to the private registry.
  4. Build the cert-watcher image.
  5. Create the namespaces and pull secrets.
  6. Prepare the TLS certificate and other secrets.
  7. Write the values file.
  8. Install the CloudNativePG operator.
  9. Install NCH.
  10. Verify the installation.

Prerequisites

RequirementDetails
Kubernetes clusterA cluster with a default StorageClass, or a StorageClass named in global.storageClassName. On OpenShift, set global.provider: openshift.
ToolsHelm 3 and kubectl with cluster-admin access, on the install host. skopeo (or another image copy tool) on the machine that mirrors the images.
Storage50 GiB for TimescaleDB, 20 GiB for Kafka and 30 GiB for the Kafka controller, as persistent volumes.
ComputeTimescaleDB requests 1 CPU and 6 GiB of memory. Plan additional capacity for the NCH services, Kafka, SPIRE and OttoFlow.
Private registryA registry reachable from every node, for example registry.mycompany.com, and a user that can push (for mirroring) and a user that can pull (for the cluster).
TLS and DNSA certificate for the NCH host name, for example nch.mycompany.com, issued by a CA your users trust, and a DNS record for the load balancer or ingress in front of haproxy.
Proxy (optional)Proxy details, if the cluster reaches any external endpoint, such as AWS Bedrock for cloud agents, through a proxy.

The examples in this guide use:

PlaceholderExample value
Private registryregistry.mycompany.com
NCH host namench.mycompany.com
NCH namespacench
Pull secret namenirmata-registry
Values filemy-values.yaml

Replace them with your own values.

Step 1: Download the install files

On a machine with internet access, download the NCH chart and the CloudNativePG chart, then copy both files to the install host in the air-gapped network.

# NCH chart (the 5.0.0 chart; use the branch or tag Nirmata gives you)
git clone https://github.com/nirmata/nch-charts.git
git -C nch-charts archive --format=tar.gz --prefix=nch-charts/ -o ../nch-charts.tgz HEAD

# CloudNativePG operator chart
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm pull cnpg/cloudnative-pg        # writes cloudnative-pg-<version>.tgz

Keep the chart’s values.yaml unchanged. Put every setting in your own values file (my-values.yaml), so a later upgrade only needs the new chart.

Step 2: Mirror the images to the private registry

Images for NCH 5.0.0

Save this list as nch-5.0-images.txt. It is for chart version 5.0.0. If you install a different version, compare it with the output of helm template for that chart.

ghcr.io/nirmata/activity:5.0.0
ghcr.io/nirmata/client-gateway:5.0.0
ghcr.io/nirmata/cluster:5.0.0
ghcr.io/nirmata/gateway-service:5.0.0
ghcr.io/nirmata/haproxy:5.0.0
ghcr.io/nirmata/kafka:v1-4.1.1
ghcr.io/nirmata/llm-apps:v5.0.0
ghcr.io/nirmata/nirmata-tunnel-server:5.0.0
ghcr.io/nirmata/policies:5.0.0
ghcr.io/nirmata/security:5.0.0
ghcr.io/nirmata/users:5.0.0
ghcr.io/nirmata/webclient:5.0.0
ghcr.io/nirmata/timescaledb:2.28.1-pg17-rev3
ghcr.io/nirmata/nctl-sandbox:v4.10.14
ghcr.io/nirmata/agent-worker:v0.1.11
ghcr.io/nirmata/ottoflow-enterprise/controller:v1.2.4
ghcr.io/nirmata/ottoflow-enterprise/agent-executor:v1.2.4
ghcr.io/nirmata/ottoflow-enterprise/workflow-runner:v1.2.4
ghcr.io/spiffe/spire-server:1.9.4
ghcr.io/spiffe/spire-agent:1.9.4
ghcr.io/spiffe/spire-controller-manager:0.6.6
ghcr.io/spiffe/spiffe-helper:0.11.0
docker.io/library/alpine:3.19
docker.io/library/busybox:1.36

Also add the CloudNativePG operator image. Its tag depends on the CNPG chart version:

helm template cnpg cloudnative-pg-<version>.tgz | grep image:

To list the images of any NCH chart version (with the default values):

for stage in base prereq others postreq cloudagents; do
  helm template nch ./nch-charts --set ${stage}.enabled=true
done | grep -oE 'image: *"?[^" ]+' | awk '{print $2}' | tr -d '"' | sort -u

Copy the images

Copy each image with its repository path kept under the registry host. From a machine that can reach both the source registries and the private registry:

REG=registry.mycompany.com
skopeo login ghcr.io
skopeo login $REG
while read -r img; do
  skopeo copy --all docker://$img docker://$REG/${img#*/}
done < nch-5.0-images.txt

With this layout:

Source imageMirrored image
ghcr.io/nirmata/policies:5.0.0registry.mycompany.com/nirmata/policies:5.0.0
ghcr.io/spiffe/spire-server:1.9.4registry.mycompany.com/spiffe/spire-server:1.9.4
docker.io/library/alpine:3.19registry.mycompany.com/library/alpine:3.19

If no machine can reach both sides, copy the images to archives on the connected side, move the archives across, and load them into the registry:

# Connected side: one archive per image, plus a list of target paths
mkdir -p images && : > images/index.txt
n=0
while read -r img; do
  n=$((n+1))
  skopeo copy --all docker://$img oci-archive:images/$n.tar
  echo "$n ${img#*/}" >> images/index.txt
done < nch-5.0-images.txt

# Air-gapped side, after copying the images/ folder across
REG=registry.mycompany.com
skopeo login $REG
while read -r n path; do
  skopeo copy --all oci-archive:images/$n.tar docker://$REG/$path
done < images/index.txt

Step 3: Build the cert-watcher image

The haproxy cert-watcher sidecar installs inotify-tools with apk when it starts. In an air-gapped cluster apk cannot reach the Alpine mirrors, so the sidecar crash-loops and the haproxy pod stays NotReady.

Build an image that already contains inotifywait on a connected machine and push it to the private registry:

FROM alpine:3.19
RUN apk add --no-cache inotify-tools
docker build -t registry.mycompany.com/nirmata/alpine-inotify:3.19 .
docker push registry.mycompany.com/nirmata/alpine-inotify:3.19

You set this image in haproxy-chart.haproxy.certwatcher.image in Step 6.

Step 4: Create the namespaces and pull secrets

Pods in five namespaces pull from the private registry, and each namespace needs its own pull secret. The secret name is global.imagePullSecrets.name (default nirmata-registry).

NamespaceWhat runs thereHow the pull secret gets there
nchNCH services, Kafka, haproxy, TimescaleDBThe chart creates it when global.imageRegistry.create: true, or you create it.
spireSPIRE server and agentThe chart creates it when spire-chart.createImagePullSecret: true, or you create it and set spire-chart.imagePullSecrets.
ottoflowOttoFlow controllerThe cloudagents stage copies it from nch (cloudagents-chart.copyImagePullSecret: true, the default).
ottoflow-agentsCloud agent runsCopied from nch by the cloudagents stage.
cnpg-systemCloudNativePG operatorYou create it, and pass it to the CNPG chart.

To create the secrets yourself, run the following before the install. Leave out the namespaces the chart covers for you.

for ns in nch spire cnpg-system; do
  kubectl create namespace $ns --dry-run=client -o yaml | kubectl apply -f -
  kubectl -n $ns create secret docker-registry nirmata-registry \
    --docker-server=registry.mycompany.com \
    --docker-username=<user> --docker-password=<password>
done

Step 5: Prepare the TLS certificate

haproxy serves the certificate in the tls-certificate secret in the NCH namespace. The chart’s values.yaml ships a sample certificate, which must be replaced. Use one of these options:

Option A: let the chart create the secret. Base64-encode the PEM certificate (with its chain) and key, and set them in the values file:

base64 -w0 nch.crt   # global.secrethelm.data.tlscrt  (macOS: base64 -i nch.crt)
base64 -w0 nch.key   # global.secrethelm.data.tlskey

Option B: create the secret yourself. Set global.secrethelm.create: false and run:

kubectl -n nch create secret generic tls-certificate \
  --from-file=tls.crt=nch.crt --from-file=tls.key=nch.key \
  --from-file=server.crt=nch.crt --from-file=server.key=nch.key

The chart stores the pair under both names, tls.* and server.*, so create both.

Other secrets

SecretPurpose
timescaledb-cnpg-appDatabase user and password. Generated by CloudNativePG for the bundled TimescaleDB; nothing to set.
Secret named in global.timescaledb.secretNameCredentials for an external PostgreSQL database, with username and password keys. Create it before the install.
llm-apps-bedrock-credsAWS Bedrock credentials (a default profile), needed by cloud agents.
slack, github-app-secret, data-pipeline-aws, users-stripe-*Optional features. Pods start without them; create them in the NCH namespace to turn the feature on.

If the NCH certificate comes from an internal CA, cloud agent pods, which call back to NCH through haproxy, must trust that CA. Set global.cloudAgents.callbackUrl only if agents must use a different URL than https://<global.product.url>.

Step 6: Write the values file

Infrastructure

SettingDescription
global.provideropenshift on OpenShift; it binds the service accounts to the anyuid SCC and drops seccompProfile. Leave empty on other clusters.
global.storageClassNameStorageClass for all volumes. Empty uses the cluster default.
global.persistence.storageClass.createBy default the chart creates a nirmata-retain StorageClass with reclaim policy Retain for Kafka and TimescaleDB, so their volumes survive helm uninstall. Set to false to use your StorageClass as it is.
global.product.urlThe NCH host name, without https://.
global.ingress.*The haproxy service is ClusterIP. Set enabled: true with className and annotations. servicePort: 8444 for an ingress that terminates TLS, 443 for TLS passthrough. Or put your own load balancer in front of haproxy on port 443.
global.proxy.*HTTPS_PROXY, HTTP_PROXY and NO_PROXY (and the lowercase forms). Include .svc and .cluster.local in NO_PROXY.

Database

  • Bundled TimescaleDB (default): timescaledb-chart creates a CNPG cluster named timescaledb-cnpg. Size it with timescaledb-chart.instances (default 1), timescaledb-chart.storage.size (default 50Gi) and timescaledb-chart.resources. Requires the CloudNativePG operator (Step 7).
  • External PostgreSQL: set timescaledb-chart.enabled: false and set global.timescaledb.host, global.timescaledb.database and global.timescaledb.secretName. The CloudNativePG operator is then not needed.

Image URLs

Image URLs are not all set in one place. Every image below must point at the private registry, or its pods stay in ImagePullBackOff.

ComponentValues key
NCH services, Kafka, haproxy, cloud agent Jobs (nctl-sandbox, agent-worker)global.common.registry = registry.mycompany.com/nirmata
TimescaleDBtimescaledb-chart.image.repository
SPIRE serverspire-chart.server.image.repository
SPIRE controller managerspire-chart.controllerManager.image.repository
SPIRE agentspire-chart.agent.image.repository
SPIRE agent init (busybox)spire-chart.agent.initImage.repository
haproxy SPIFFE sidecars (spiffe-helper)haproxy-chart.haproxy.spiffecertfetch.image.repository, haproxy-chart.haproxy.spiffehelper.image.repository
haproxy cert concat (alpine)haproxy-chart.haproxy.spiffecertconcat.image.repository
haproxy cert-watcherhaproxy-chart.haproxy.certwatcher.image.repository and tag (the image from Step 3)
OttoFlowcloudagents-chart.ottoflow.{controller,agentExecutor,workflowRunner}.image.registry = registry.mycompany.com/nirmata/ottoflow-enterprise
CloudNativePG operatorThe CNPG chart’s image.repository (Step 7)

SPIRE

SettingDescription
global.spire.trustDomainSPIFFE trust domain (default nirmata.io).
global.spire.clusterNameCluster name in SPIRE (default nirmata).
spire-chart.enabledSet to false if SPIRE already runs in the cluster. global.spire.registerWorkloads still creates the ClusterSPIFFEID for the NCH namespace.
spire-chart.server.caTTLSPIRE publishes a new CA every caTTL / 2 (84 hours with the default 168h). The cert-watcher sidecar reloads haproxy when the CA or haproxy’s certificate changes.
global.haproxy.hardStopAfterHow long an old haproxy worker keeps long-lived WebSockets open after a reload (default 30m).

Cloud agents (optional)

SettingDescription
global.cloudAgents.ottoflowNamespace, agentsNamespaceNamespaces for OttoFlow (ottoflow) and agent runs (ottoflow-agents).
cloudagents-chart.namespaces.createSet to false if the namespaces already exist.
cloudagents-chart.ottoflow.enabledSet to false to use an existing OttoFlow.

Agents send LLM calls through llm-apps to AWS Bedrock. In an air-gapped cluster this needs a route to Bedrock (a VPC endpoint or the proxy) and the llm-apps-bedrock-creds secret. Without them, agent runs fail at the report step.

Some agents need extra read access on each managed cluster, granted to the kube-controller service account: nirmata:rbac-blast-radius-reader, nirmata:resource-hygiene-reader, and metrics.k8s.io read access for cost-analyzer.

Sample values file

A complete my-values.yaml for an air-gapped install. Replace the host names, credentials, certificate and storage values with your own.

global:
  provider: ""                      # "openshift" on OpenShift
  storageClassName: ""              # empty = cluster default
  common:
    registry: registry.mycompany.com/nirmata
  product:
    url: nch.mycompany.com
  imagePullSecrets:
    name: nirmata-registry
  imageRegistry:
    create: true                    # false if you created the secret in Step 4
    server: registry.mycompany.com
    username: <user>
    password: <password>
  secrethelm:
    create: true                    # false if you created tls-certificate in Step 5
    data:
      tlscrt: <base64 PEM certificate and chain>
      tlskey: <base64 PEM private key>
  ingress:
    enabled: true
    className: nginx
    servicePort: 8444
  proxy:
    HTTPS_PROXY: null
    NO_PROXY: null

timescaledb-chart:
  instances: 1
  storage:
    size: 50Gi
  image:
    repository: registry.mycompany.com/nirmata/timescaledb

spire-chart:
  createImagePullSecret: true
  server:
    image:
      repository: registry.mycompany.com/spiffe/spire-server
  controllerManager:
    image:
      repository: registry.mycompany.com/spiffe/spire-controller-manager
  agent:
    image:
      repository: registry.mycompany.com/spiffe/spire-agent
    initImage:
      repository: registry.mycompany.com/library/busybox

haproxy-chart:
  haproxy:
    spiffecertfetch:
      image:
        repository: registry.mycompany.com/spiffe/spiffe-helper
    spiffehelper:
      image:
        repository: registry.mycompany.com/spiffe/spiffe-helper
    spiffecertconcat:
      image:
        repository: registry.mycompany.com/library/alpine
    certwatcher:
      image:
        repository: registry.mycompany.com/nirmata/alpine-inotify
        tag: "3.19"

cloudagents-chart:
  ottoflow:
    controller:
      image:
        registry: registry.mycompany.com/nirmata/ottoflow-enterprise
    agentExecutor:
      image:
        registry: registry.mycompany.com/nirmata/ottoflow-enterprise
    workflowRunner:
      image:
        registry: registry.mycompany.com/nirmata/ottoflow-enterprise

Before installing, render the chart and check that no image still points at a public registry:

for stage in base prereq others postreq cloudagents; do
  helm template nch ./nch-charts -n nch -f my-values.yaml --set ${stage}.enabled=true
done | grep -E 'image:' | grep -v registry.mycompany.com

The command should print nothing.

Step 7: Install the CloudNativePG operator

Skip this step if you use an external PostgreSQL database.

Install the operator from the chart you copied in, with its image and pull secret pointed at the private registry:

helm install cnpg ./cloudnative-pg-<version>.tgz -n cnpg-system --create-namespace \
  --set image.repository=registry.mycompany.com/cloudnative-pg/cloudnative-pg \
  --set imagePullSecrets[0].name=nirmata-registry
kubectl -n cnpg-system rollout status deploy/cnpg-cloudnative-pg

If the operator is missing, the NCH base stage stops with timescaledb-chart requires the CloudNativePG operator.

Step 8: Install NCH

NCH is installed as five Helm releases, in order, with the same namespace and values file for each:

ReleaseStage flagContents
nch-basebase.enabledTimescaleDB cluster, SPIRE (server, agent and CRDs), Kafka and the Kafka controller, shared ConfigMaps, TLS and pull secrets, StorageClass and PriorityClasses
nch-preprereq.enabledusers and security (and iam, when enabled)
nch-servicesothers.enabledactivity, client-gateway, cluster, cluster-processor, gateway-service, llm-apps, policies, policies-event-processor, policies-processor, webclient and the tunnel server
nch-postreqpostreq.enabledhaproxy, the entry point for the UI, the API and managed cluster tunnels
nch-cloudagentscloudagents.enabledOttoFlow Enterprise, the agent namespaces and RBAC, and the cloud agent workflows

Option A: install script

Unpack the chart archive and run the install script from its root:

tar xzf nch-charts.tgz && cd nch-charts
./scripts/nch/install-all.sh -n nch --create-namespace -f my-values.yaml

The script waits a fixed 60 seconds after the base stage and 30 seconds after the next two.

When image pulls from the private registry are slow, the fixed waits in the script can be too short. Install each stage by hand and wait until its pods are Running and Ready before starting the next:

helm install nch-base ./nch-charts -n nch --create-namespace -f my-values.yaml --set base.enabled=true
kubectl -n nch wait --for=condition=Ready cluster.postgresql.cnpg.io/timescaledb-cnpg --timeout=15m
kubectl -n nch wait --for=condition=Ready pod --all --field-selector=status.phase!=Succeeded --timeout=15m
kubectl -n spire wait --for=condition=Ready pod --all --timeout=10m

helm install nch-pre ./nch-charts -n nch -f my-values.yaml --set prereq.enabled=true
kubectl -n nch wait --for=condition=Ready pod --all --field-selector=status.phase!=Succeeded --timeout=10m

helm install nch-services ./nch-charts -n nch -f my-values.yaml --set others.enabled=true
kubectl -n nch wait --for=condition=Ready pod --all --field-selector=status.phase!=Succeeded --timeout=15m

helm install nch-postreq ./nch-charts -n nch -f my-values.yaml --set postreq.enabled=true
kubectl -n nch rollout status deploy/haproxy --timeout=10m

helm install nch-cloudagents ./nch-charts -n nch -f my-values.yaml --set cloudagents.enabled=true \
  --wait --timeout 10m

nch-cloudagents is installed with --wait because the OttoFlow webhook must be running to validate the workflows.

Step 9: Verify the installation

helm list -n nch                                   # five releases, all "deployed"
kubectl get pods -n nch
kubectl get cluster.postgresql.cnpg.io -n nch      # timescaledb-cnpg: "Cluster in healthy state"
kubectl get pods -n spire
kubectl get pods -n ottoflow
kubectl get pods -A | grep -E "ImagePull|ErrImage"  # should print nothing
kubectl logs -n nch deploy/haproxy -c cert-watcher  # shows haproxy.pem being generated
curl -I https://nch.mycompany.com

Then open https://<global.product.url> in a browser, sign in, add the license and create the first tenant. To start managing clusters, see Onboard a cluster in Nirmata.

Upgrade

  1. Mirror the new version’s images (Step 2).
  2. Copy in the new chart.
  3. Update any image tags you pinned in my-values.yaml.
  4. Run the upgrade script with the same arguments as the install:
./scripts/nch/upgrade-all.sh -n nch -f my-values.yaml

The script runs helm upgrade for the first four releases and helm upgrade --install for nch-cloudagents.

Uninstall

./scripts/nch/delete-all.sh -n nch

delete-all.sh also deletes the cloud agent Workflows and Agents, which helm uninstall leaves behind because they are Helm hooks. Set OTTOFLOW_NAMESPACE if OttoFlow is not in ottoflow.

With the default Retain reclaim policy, the Kafka and TimescaleDB volumes stay after uninstall. Delete the PersistentVolumes by hand to remove the data.

Troubleshooting

SymptomCauseFix
Pod in ImagePullBackOff or ErrImagePullAn image URL still points at a public registry, or the namespace has no pull secret.kubectl describe pod shows the image it tried to pull. Add the missing override (Image URLs) or the pull secret (Step 4), then helm upgrade that release.
haproxy pod NotReady, cert-watcher container crash-loopingThe default cert-watcher image runs apk add at start-up and cannot reach the internet.Use the prebuilt image from Step 3.
nch-base fails with timescaledb-chart requires the CloudNativePG operatorThe CNPG operator is not installed.Install it (Step 7), or use an external database.
Services in nch-pre or nch-services crash-loop at startThe stage before them was not ready yet.Install stage by hand (Option B).
nch-cloudagents install fails on workflow validationThe OttoFlow controller or its webhook is not running, often because of a missing pull secret in ottoflow.Check kubectl get pods -n ottoflow and the pull secret, then rerun the stage.
Cloud agent runs fail at the report stepNo route to AWS Bedrock, or no llm-apps-bedrock-creds secret.Provide a VPC endpoint or proxy route to Bedrock and create the secret.
Browser shows a certificate warningThe sample certificate is still in use, or the chain is incomplete.Replace tls-certificate with your certificate and its full chain (Step 5).

Limitations

  • Image URLs in several places: global.common.registry covers the Nirmata images, but TimescaleDB, SPIRE, the haproxy sidecars, OttoFlow and the CNPG operator each need their own override.
  • Pull secrets per namespace: the nch, spire and cnpg-system namespaces each need the pull secret; the OttoFlow namespaces get a copy from the cloudagents stage.
  • cert-watcher image: the default cert-watcher installs packages at start-up, so an air-gapped install needs a prebuilt image.
  • Staged install: NCH 5.0 is five Helm releases installed in order, and the install script uses fixed waits instead of readiness checks.
  • Replicas: every service, Kafka and haproxy default to one replica, and TimescaleDB to one instance. Raise each service’s replicas and timescaledb-chart.instances for high availability.
  • Cloud agents: agent runs need a route to AWS Bedrock and the llm-apps-bedrock-creds secret, which an air-gapped network may not allow.