Running nplus with Flux#
How the operator runs an nplus instance with Flux: the charts come from the
helm registry of the nplus organisation, the values and the pin live in the
operator’s own Git repository, Flux installs them with real helm upgrade.
| File | What it is |
|---|---|
kustomization.yaml | entry point; builds the two value ConfigMaps from the files below |
namespace.yaml | namespace nplus, Pod Security Standard restricted |
sources.yaml | where the charts come from: the helm registry of nplus |
helmrelease.yaml | the environment and the instance: chart version, values, retries, rollback |
environment.yaml | the operator’s values (secrets by name only) |
version.yaml | the pin: a copy of one file from versions/ |
Install#
Flux is installed in the cluster (flux bootstrap …; the source, helm and
kustomize controllers are enough). The CRDs of nplus are installed once per
cluster with the cluster chart (see the cluster sample),
before any environment. The operator copies this folder into their Git
repository, adapts environment.yaml, creates the secrets, and points a Flux
Kustomization at the folder:
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: nplus
namespace: flux-system
spec:
interval: 10m
path: ./nplus
prune: true
sourceRef:
kind: GitRepository
name: flux-systemSecrets the instance needs (namespace nplus): nplus-charts-helm (username
and password with read access to the packages of nplus), nscale-cr and
nplus-cr (pull secrets for registry.source.ceyoniq.com and git.42i.org,
type kubernetes.io/dockerconfigjson), nscale-license (key license.xml,
the name is global.license in environment.yaml). With Flux they usually live
next to this folder as SOPS-encrypted Secrets.
Environment and instance#
An nplus instance runs in an nplus environment: the namespace with the
operator, the toolbox and the shared volumes conf and ptemp. So this sample
has two HelmReleases: environment (chart nplus-environment) and the
instance demo (chart nplus-instance), which waits for the environment with
dependsOn. Both read environment.yaml, only the instance reads
version.yaml. More instances in the same namespace get a HelmRelease of their
own; the environment stays once per namespace.
Both HelmReleases read the same environment.yaml, so a change to it upgrades
the environment and the instance.
The Argo CD waves and hooks in the manifests are ignored by Flux, and the
charts have no helm hooks. The components wait for each other by their wait
init containers (waitFor), the application and prepper jobs as well.
Flux waits for these jobs to finish before it reports the instance as ready,
and every upgrade of the instance runs them again: the operator removes a
finished job, so the next upgrade creates it anew. This is intended, so the
scripts of the application job (preRun, document areas) must be safe to run
more than once. The environment does not wait for its jobs (the nstore download
of the toolbox can take a while); it has a timeout of 20 minutes like the
instance.
Pin an nscale version#
Replace version.yaml with another file from versions/ and commit. Flux sees
the changed ConfigMap and runs helm upgrade. Nothing else changes: the chart
version and the operator’s values stay as they are. The sample pins nscale
10.1; keep the version of the files in line with your license.
Within a minor release (10.1.x) the components roll one after another. The
StatefulSets with the update strategy OnDelete (the storage layer nstl, the
database and the administration components) take the new version only when
their pod is deleted: after the pin, delete these pods one after another. A step
to another minor or major release changes the database schema and needs all
Application Layers down at once: scale every component with an Application
Layer to 0 (nappl, and nappljobs if the instance runs a dedicated one:
kubectl scale statefulset -n nplus -l nplus/type=core,nplus/instance=demo --replicas=0), then commit the new version.yaml; the upgrade starts them
again in the new version.
Go back one step#
Put the previous version.yaml back and commit (git revert of the pin
commit). This works within a minor release; a step to another minor or major
release cannot be rolled back. Back up the database before every pin.
If an upgrade fails, the HelmRelease rolls back to the previous release by
itself (upgrade.remediation.strategy: rollback); the commit in Git then
still names the new version, and Flux reports the release as failed until the
pin is fixed or reverted.
Update the charts#
The chart version is set in helmrelease.yaml (chart.spec.version), the
nscale version in version.yaml. The chart version does not decide which
nscale version runs. The range 26.5.x follows every release of the line, the
corrections of 26.5; name an exact version (26.5.1000) to change it only by a
commit. Pre-releases (26.5.1000-<n>) are only taken when named exactly. Keep
both HelmReleases on the same version, see Versioning.
Check what Flux would render#
kubectl kustomize samples/flux
helm template environment charts/environment \
--values samples/flux/environment.yaml
helm template demo charts/instance \
--values samples/flux/environment.yaml \
--values samples/flux/version.yamlbuild.sh does all three; the PR gate runs it with the other samples.
Files#
Download all files of this sample
build.sh#
#!/bin/bash
#
# Renders the flux sample: the kustomization Flux would apply, and both charts
# with exactly the values the HelmReleases pass (environment, then version).
#
# Make sure it fails immediately, if anything goes wrong
set -e
# -- ENVironment variables:
# CHARTS: The path to the source code
# DEST: The path to the build destination
# SAMPLES: The path to the samples
# The kube context does not matter here: the sample brings its own values.
# Check, if we have the source code available
if [ ! -d "$CHARTS" ]; then
echo "ERROR Building flux example: The Charts Sources folder is not set. Please make sure to run this script with the full Source Code available"
exit 1
fi
if [ ! -d "$DEST" ]; then
echo "ERROR Building flux example: DEST folder not found."
exit 1
fi
if [ ! -d "$CHARTS/instance" ]; then
echo "ERROR Building flux example: Chart Sources in $CHARTS/instance not found. Are you running this script as a subscriber?"
exit 1
fi
# Set the Variables
SAMPLE="flux"
NAME="sample-$SAMPLE"
# Output what is happening
echo "Building $NAME"
# The kustomization Flux applies
mkdir -p $DEST/flux
kubectl kustomize $SAMPLES/flux > $DEST/flux/kustomization.yaml
# The environment, as the HelmRelease "environment" installs it
mkdir -p $DEST/environment
helm template --debug \
--values $SAMPLES/flux/environment.yaml \
$NAME-environment $CHARTS/environment > $DEST/environment/$SAMPLE.yaml
# The instance, as the HelmRelease "demo" installs it
mkdir -p $DEST/instance
helm template --debug \
--values $SAMPLES/flux/environment.yaml \
--values $SAMPLES/flux/version.yaml \
$NAME $CHARTS/instance > $DEST/instance/$SAMPLE.yamlenvironment.yaml#
# The operator's values for this installation, read by the environment and by
# the instance. Secrets are referred to by name; they are created in the
# cluster and never committed (with Flux for example as SOPS-encrypted Secrets
# next to this file).
components:
nappl: true
web: true
rs: true
nstl: true
database: true
global:
# Secret with the key license.xml (the nscale license)
license: nscale-license
environment:
ingress:
domain: "{{ .instance.group | default .Release.Name }}.nplus.example.com"
class: nginx
# a cert-manager issuer; empty for a self-signed certificate
issuer: letsencrypt
storage:
# conf and ptemp need ReadWriteMany
conf:
class:
ptemp:
class:
data:
class:
disk:
class:
# The images are pulled with the secrets nscale-cr (registry.source.ceyoniq.com)
# and nplus-cr (git.42i.org), the default of every component. Other names:
# pullSecretsOverride:
# - my-registryhelmrelease.yaml#
# The nplus environment and the instance as Flux HelmReleases.
#
# Values come from two ConfigMaps (kustomization.yaml builds them from files):
# demo-environment the operator's values (environment.yaml), read by both
# demo-version the nscale version to run (version.yaml, a copy of a file
# from versions/) — changing this file is the pin
# The later entry wins, exactly like `--values a --values b` with helm.
#
# The environment (operator, toolbox, shared volumes) runs once per namespace,
# before any instance in it; `dependsOn` makes Flux wait for it.
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: environment
namespace: nplus
spec:
interval: 10m
releaseName: environment
chart:
spec:
chart: nplus-environment
# A range ("26.5.x") takes every release of the line, the corrections of
# 26.5; an exact version ("26.5.1000") changes only by a commit.
# Pre-releases (26.5.1000-<n>, built from main) only when named exactly.
version: "26.5.x"
sourceRef:
kind: HelmRepository
name: nplus-charts
interval: 30m
valuesFrom:
- kind: ConfigMap
name: demo-environment
valuesKey: values.yaml
install:
remediation:
retries: 3
# The toolbox may download the nstore when the environment is installed;
# that job takes longer than the default of 5 minutes. A timeout would make
# the remediation uninstall the environment with its volumes and start over.
timeout: 20m
disableWaitForJobs: true
upgrade:
remediation:
retries: 1
strategy: rollback
timeout: 20m
disableWaitForJobs: true
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: demo
namespace: nplus
spec:
interval: 10m
releaseName: demo
dependsOn:
- name: environment
chart:
spec:
chart: nplus-instance
# The same version as the environment: all nplus charts of a release
# carry the same version.
version: "26.5.x"
sourceRef:
kind: HelmRepository
name: nplus-charts
interval: 30m
valuesFrom:
- kind: ConfigMap
name: demo-environment
valuesKey: values.yaml
- kind: ConfigMap
name: demo-version
valuesKey: values.yaml
install:
remediation:
retries: 3
# The nscale images are several GB; the first pull takes longer than the
# default of 5 minutes.
timeout: 20m
upgrade:
# A failed upgrade goes back to the previous release.
remediation:
retries: 1
strategy: rollback
# StatefulSets roll one pod after another; wait for it.
timeout: 20m
rollback:
timeout: 20m
# The charts have no helm hooks. The order of the components comes from the
# wait init containers (waitFor); the Argo CD waves and hooks in the manifests
# are ignored by Flux.kustomization.yaml#
# Entry point for Flux (a Kustomization of the operator points here) or for
# `kubectl apply -k samples/flux`.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: nplus
resources:
- namespace.yaml
- sources.yaml
- helmrelease.yaml
generatorOptions:
# stable names, so the HelmReleases can refer to them
disableNameSuffixHash: true
labels:
# helm-controller reconciles at once when one of them changes
reconcile.fluxcd.io/watch: Enabled
configMapGenerator:
- name: demo-environment
files:
- values.yaml=environment.yaml
- name: demo-version
files:
- values.yaml=version.yamlnamespace.yaml#
apiVersion: v1
kind: Namespace
metadata:
name: nplus
labels:
# the charts satisfy the Pod Security Standard "restricted"
pod-security.kubernetes.io/enforce: restrictedsources.yaml#
# Where Flux takes the nplus charts from: the helm registry of the nplus
# organisation on git.42i.org, where every published chart version lands, the
# same one you use with `helm repo add`.
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: nplus-charts
namespace: nplus
spec:
interval: 30m
url: https://git.42i.org/api/packages/nplus/helm
# Secret with username and password (read access to the packages of nplus).
secretRef:
name: nplus-charts-helmversion.yaml#
# The pin of this installation: a copy of versions/10.1.1515.yaml of nplus.
# Pinning another nscale version = replacing this file with another one from
# versions/ and committing it. Going back one step = the previous file.
# nscale 10.1.1515: version and image of every nscale component, plus the third-party
# images the stack needs. Stack it with --values to run this nscale version.
# Generated by bin/getVersion (weekly: bin/nscaleVersions), do not edit by hand.
global:
meta:
nscaleVersion: "10.1.1515"
logForwarderImage:
tag: "5.0"
application:
meta:
componentVersion: "10.1.1515"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: application-layer
tag: ubi.10.1.1515.2026101521
nappl:
meta:
componentVersion: "10.1.1515"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: application-layer
tag: ubi.10.1.1515.2026101521
nappljobs:
meta:
componentVersion: "10.1.1515"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: application-layer
tag: ubi.10.1.1515.2026101521
web:
meta:
componentVersion: "10.1.1511"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: application-layer-web
tag: ubi.10.1.1511.255470
mon:
meta:
componentVersion: "10.1.1503"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: monitoring-console
tag: ubi.10.1.1503.2026112610
rs:
meta:
componentVersion: "10.1.1505"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: rendition-server
tag: ubi.10.1.1505.2026112609
nstl:
meta:
componentVersion: "10.1.1501"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: storage-layer
tag: ubi.10.1.1501.179862
nstla:
meta:
componentVersion: "10.1.1501"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: storage-layer
tag: ubi.10.1.1501.179862
nstlb:
meta:
componentVersion: "10.1.1501"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: storage-layer
tag: ubi.10.1.1501.179862
nstlc:
meta:
componentVersion: "10.1.1501"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: storage-layer
tag: ubi.10.1.1501.179862
nstld:
meta:
componentVersion: "10.1.1501"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: storage-layer
tag: ubi.10.1.1501.179862
pipeliner:
meta:
componentVersion: "10.1.1511"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: pipeliner
tag: ubi.10.1.1511.255358
cmis:
meta:
componentVersion: "10.1.1501"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: cmis-connector
tag: ubi.10.1.1501.2026032416
ilm:
meta:
componentVersion: "10.1.1102"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: erp-ilm-connector
tag: ubi.10.1.1102.246447
erpproxy:
meta:
componentVersion: "10.1.1101"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sap-proxy-connector
tag: ubi.10.1.1101.2025103014
erpproxya:
meta:
componentVersion: "10.1.1101"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sap-proxy-connector
tag: ubi.10.1.1101.2025103014
erpproxyb:
meta:
componentVersion: "10.1.1101"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sap-proxy-connector
tag: ubi.10.1.1101.2025103014
erpproxyc:
meta:
componentVersion: "10.1.1101"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sap-proxy-connector
tag: ubi.10.1.1101.2025103014
erpproxyd:
meta:
componentVersion: "10.1.1101"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sap-proxy-connector
tag: ubi.10.1.1101.2025103014
erpcmis:
meta:
componentVersion: "10.1.1500"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: erp-cmis-connector
tag: ubi.10.1.1500.2026021916
webdav:
meta:
componentVersion: "10.1.1100"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: webdav-connector
tag: ubi.10.1.1100.2025102913
administrator:
meta:
componentVersion: "10.1.1502"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: administrator
tag: ubi.10.1.1502.255078
pam:
meta:
componentVersion: "10.1.1400"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: process-automation-modeler
tag: ubi.10.1.1400.147478
sharepoint:
meta:
componentVersion: "9.2.1505"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sharepoint-connector
tag: ubi.9.2.1505.0
sharepointa:
meta:
componentVersion: "9.2.1505"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sharepoint-connector
tag: ubi.9.2.1505.0
sharepointb:
meta:
componentVersion: "9.2.1505"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sharepoint-connector
tag: ubi.9.2.1505.0
sharepointc:
meta:
componentVersion: "9.2.1505"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sharepoint-connector
tag: ubi.9.2.1505.0
sharepointd:
meta:
componentVersion: "9.2.1505"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/release
name: sharepoint-connector
tag: ubi.9.2.1505.0
aibackend:
meta:
componentVersion: "10.3.1100"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/nscale-ai
name: backend
tag: ubi.10.3.1100
aichat:
meta:
componentVersion: "10.3.1100"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/nscale-ai
name: chat-ui
tag: ubi.10.3.1100
aimcp:
meta:
componentVersion: "10.3.1000"
image:
repo: registry.source.ceyoniq.com/ceyoniq-public/nscale/container/nscale-ai
name: applicationlayer-mcp-server
tag: ubi.10.3.1000
aiauth:
meta:
componentVersion: "7.15.6"
image:
repo: quay.io/oauth2-proxy
name: oauth2-proxy
tag: v7.15.6
aisearch:
meta:
componentVersion: "8.19.24"
elasticsearch:
version: "8.19.24"
database:
meta:
componentVersion: "16"
image:
repo:
name: bitnamilegacy/postgresql
tag: "16"