Skip to main content

Helm chart

Production Kubernetes deployment: one all-in-one workload scaled by replicaCount, a leader-elected scheduler, External Secrets integration, and the graceful-shutdown behaviour upgrades depend on.

Install​

# The chart is published to the OCI registry (listed on Artifact Hub) — there is no classic Helm repo to add.
helm install cap oci://ghcr.io/cloudnativeworks/charts/certautopilot \
--namespace cap --create-namespace \
--version 1.5.52 \
-f values.yaml

The chart version equals the application version (--version 1.5.52 deploys CertAutoPilot 1.5.52); the container images default to that same tag (image.tag / frontend.image.tag empty = the chart's appVersion), published on Docker Hub as jhonbrownn/certautopilot-backend and jhonbrownn/certautopilot-frontend — linux/amd64 only, so the nodes must be x86-64 (an arm64 node such as Graviton or Apple Silicon fails with "no match for platform"). On a first install the backend restarts a few times until the bundled MongoDB is ready; that is expected. A quick evaluation install with the bundled MongoDB needs only the three secret values:

helm install cap oci://ghcr.io/cloudnativeworks/charts/certautopilot \
--namespace cap --create-namespace --version 1.5.52 \
--set secrets.jwt.secret="$(openssl rand -base64 48)" \
--set-string secrets.encryption.kekVersions.1="$(openssl rand -hex 32)" \
--set secrets.encryption.currentVersion=1

Keep the KEK you generated — it is immutable after the first start (see KEK rotation).

Minimum values.yaml​

replicaCount: 2 # backend replicas; the scheduler inside them is leader-elected

mongodb:
enabled: false # do NOT also deploy the bundled Bitnami MongoDB
externalMongodb:
enabled: true
uri: mongodb://mongo-rs-0.mongo:27017,mongo-rs-1.mongo:27017,mongo-rs-2.mongo:27017/certautopilot?replicaSet=rs0

secrets:
jwt:
secret: "<random string>" # required in release mode unless secrets.existingSecret is set
encryption:
provider: env
currentVersion: 1 # seeds the first install only; the keystore is authoritative afterwards
kekVersions:
"1": "<64 hex chars>" # every version existing data references must stay listed

scheduler:
leaderLockTTL: "90s" # chart default is 2h — see below

Extra backend environment variables go under extraEnv (the Kubernetes env list form, so valueFrom works too). They survive helm upgrade, unlike kubectl set env:

extraEnv:
- name: CERTAUTOPILOT_WINRM_SHELL_REUSE # WinRM kill switch, see the WinRM troubleshooting page
value: "false"
- name: CERTAUTOPILOT_WINDNS_BATCH # Windows DNS: one PowerShell run per record (see Windows DNS)
value: "false"

The other WinRM kill switch, CERTAUTOPILOT_WINRM_KERBEROS_LOGIN_CACHE=false, goes back to a Kerberos login per WinRM request.

warning
externalMongodb.uri is rendered into a ConfigMap in plaintext

It is not a Secret path. If the connection string carries credentials, they end up readable by anyone who can read ConfigMaps in the namespace.

warning
Set scheduler.leaderLockTTL

The chart ships 2h, while the code's own default is 90 s. Left alone, a scheduler failover on Kubernetes can take up to two hours. Set it to 90s unless you have a reason not to.

The bundled MongoDB is for evaluation

mongodb.enabled defaults to true and deploys the Bitnami MongoDB sub-chart. Two things to know before relying on it: the sub-chart no longer pins an image tag (it resolves bitnami/mongodb:latest, so a pod restart can land on a newer MongoDB major — set mongodb.image.tag yourself), and the generated root password survives a plain helm upgrade only because the sub-chart reads the existing Secret from the cluster — tooling that renders without cluster access (helm template, some GitOps flows) regenerates it and MongoDB stops authenticating, so set mongodb.auth.rootPassword explicitly there. For production use externalMongodb with mongodb.enabled: false.

Reaching the UI​

Both Services speak HTTPS: the backend always terminates TLS (a self-signed certificate is generated unless tls.certPEM/tls.keyPEM are set), and the frontend's nginx serves the UI on 443 and proxies /api to the backend. Defaults are NodePort services — frontend on 30051, backend on 30050 — so after install the UI is at https://<node-ip>:30051 (accept the self-signed certificate). helm install prints the exact commands. For a real hostname put your own Ingress in front of the <release>-certautopilot-frontend Service; the chart ships none. Set frontend.backendUrl only when the browser must reach the API on a different origin than the UI. It must be a plain http:// or https:// address: a host name of letters, digits, dots and hyphens (no underscore) or a bracketed IPv6 address, an optional port, and an optional path of letters, digits and . _ ~ / -. Anything else — user info (user@), a query string, a fragment, % or + in the path, quotes or spaces — stops the chart from rendering. Only its scheme, host and port are added to the UI's content security policy (connect-src), which is what lets the browser call that origin; the path is not. Single sign-on needs the UI and the API on one origin (the public URL), so leave backendUrl empty when you use it.

Workloads​

The chart deploys two Deployments and two Services, plus an optional ServiceMonitor and PrometheusRule.

WorkloadModeNotes
backendall — fixedRuns API, worker and scheduler in one process. Scale with replicaCount; the scheduler is leader-elected via MongoDB, so extra replicas are safe.
frontend—Serves the React bundle.

There is no Ingress, no HorizontalPodAutoscaler and no PodDisruptionBudget in the chart — add your own if you need them. There is also no per-mode split: the backend's arguments are fixed at serve --mode=all, so api: / worker: / scheduler: value keys do nothing.

External Secrets​

In release mode the chart requires either plaintext secrets.jwt.secret and secrets.encryption.kekVersions in values, or secrets.existingSecret naming a pre-created Secret — rendering fails with an explicit error if neither is present. Use existingSecret to keep secrets out of values.yaml entirely. Most users wire them up via External Secrets Operator pulling from AWS Secrets Manager, GCP SM, or Vault.

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata: {name: cap-kek, namespace: cap}
spec:
refreshInterval: 1h
secretStoreRef: {name: aws-sm, kind: ClusterSecretStore}
target: {name: cap-kek}
data:
- secretKey: encryption-env-kek-v1 # 64 hex chars, not raw bytes
remoteRef: {key: certautopilot/prod/kek-v1}
- secretKey: encryption-current-version
remoteRef: {key: certautopilot/prod/kek-current-version}
- secretKey: jwt-secret
remoteRef: {key: certautopilot/prod/jwt}

Point the chart at it with secrets.existingSecret: cap-kek and secrets.existingSecretVersions: [1]. The key names are fixed — the chart reads encryption-env-kek-v{N}, one per version, and refuses to render if kekVersions is empty while provider: env.

Metrics​

/metrics is served over HTTPS on the backend's own port (config.server.port, 8181 by default) — not on a separate 9090. Set serviceMonitor.enabled=true (note: top-level, not metrics.serviceMonitor) to deploy the ServiceMonitor for Prometheus Operator users.

The backend Service is a NodePort (30050 by default), so /metrics is reachable by anyone who can reach a node on that port. Set serviceMonitor.bearerTokenSecret.name (and .key, default token) to an existing Secret: the backend then requires that token on /metrics and the ServiceMonitor sends it.

Draining nodes​

The chart ships no PodDisruptionBudget. On SIGTERM the worker waits up to 55 seconds for its in-flight job to finish and only then releases the lock. The chart, however, sets terminationGracePeriodSeconds: 30 and installs no preStop hook — so a job still running at 30 seconds is SIGKILLed, and its lock is only reclaimed after the 5-minute lock TTL expires.

Raise terminationGracePeriodSeconds to 60 if your jobs routinely run longer than 30 seconds. Size drain windows against the 5-minute TTL either way, and add your own PDB if you need to bound simultaneous evictions.

Upgrade​

helm upgrade cap oci://ghcr.io/cloudnativeworks/charts/certautopilot \
--namespace cap \
--version 1.5.52 \
-f values.yaml \
--atomic --wait

There is no migration job — the chart ships none, and there are no schema migrations to run. --atomic rolls back if the rollout fails. The bundled MongoDB keeps its generated password across the upgrade (see the caution above for GitOps renderers).

See also​