spatiumddi

by joaquinito2051

Helm chartv1.0.1App 1.0.1

SpatiumDDI — all-in-one DDI (DNS, DHCP, IPAM) control plane + optional managed service agents

About this chart

SpatiumDDI Helm chart

Umbrella chart that deploys the full SpatiumDDI control plane (API + frontend + Celery worker + Celery beat + migrate Job) plus PostgreSQL and Redis via Bitnami subcharts, with optional DNS and DHCP agent StatefulSets.

  • Chart type: application
  • Registry: oci://ghcr.io/spatiumnorth/charts/spatiumddi
  • Versioning: Each SpatiumDDI release tag publishes a chart version. A CalVer tag (YYYY.MM.DD-N, up to the bridge release) has its leading zeroes stripped so it's a valid SemVer 2 identifier — e.g. tag 2026.04.20-1 → chart version 2026.4.20-1. A SemVer tag (from 1.0.0) is the chart version unchanged. Every CalVer chart is a SemVer pre-release, so Helm finds it only with an explicit --version.

TL;DR

helm install ddi oci://ghcr.io/spatiumnorth/charts/spatiumddi \
  --version 2026.4.20-1 \
  --namespace spatiumddi --create-namespace

Chart versions up to and including 2026.9.4-1 default to the old image path. They were published before the project moved to the spatiumnorth organization (#1100), so their values name ghcr.io/spatiumddi/*, which now answers denied. The same image tags are published under ghcr.io/spatiumnorth/; add these to install or upgrade one of those versions:

  --set image.repository=spatiumnorth \
  --set dnsAgents.image.repository=ghcr.io/spatiumnorth/dns-bind9 \
  --set dnsAgents.flavors.powerdns.repository=ghcr.io/spatiumnorth/dns-powerdns \
  --set dnsAgents.flavors.technitium.repository=ghcr.io/spatiumnorth/dns-technitium \
  --set dhcpAgents.image.repository=ghcr.io/spatiumnorth/dhcp-kea

Default login: admin / admin (forced password change on first login).

Prerequisites

  • Kubernetes 1.31+
  • Helm 3.8+ (needed for OCI)
  • A StorageClass supporting ReadWriteOnce (Postgres, Redis, and agent state all use PVCs)
  • Ingress controller or LoadBalancer for external access (optional)

Install

# Default install — all-in-one with bundled Postgres + Redis
helm install ddi oci://ghcr.io/spatiumnorth/charts/spatiumddi \
  --version <CHART_VERSION> \
  --namespace spatiumddi --create-namespace

Exposing the UI

# values.yaml
ingress:
  enabled: true
  className: nginx
  hosts:
    - host: ddi.example.com
      paths:
        - { path: /, pathType: Prefix }
  tls:
    - secretName: ddi-tls
      hosts: [ddi.example.com]
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod

Behind an Ingress, also set frontend.trustedProxyCidrs to the ingress controller's pod network (so the login throttle and audit log see the real client, and the api sees https) and turn off response buffering for the streaming endpoints (nginx.ingress.kubernetes.io/proxy-buffering: "off", proxy-read-timeout: "3600"). See docs/deployment/REVERSE_PROXY.md.

Or, without an Ingress, flip the frontend service to LoadBalancer:

frontend:
  service:
    type: LoadBalancer

The frontend Pod's embedded nginx proxies /api/ (plus /health and /metrics) to the api Service — same shape as Docker Compose. /metrics answers only a bearer token: the scrape token the chart generates into its app Secret as metrics-token, or any API token (#1159). The upstream host + port come from values; the cluster DNS resolver is auto-detected from /etc/resolv.conf at container start. Defaults work out of the box ({{ fullname }}-api on api.service.port).

Override only for non-default topologies — separate namespace, custom api Service name, pinned external resolver:

frontend:
  apiUpstream:
    host: my-api.shared-ns.svc.cluster.local
    port: 8000
  nginxLocalResolvers: "10.96.0.10"   # optional; auto-detected if empty

If you'd rather skip the frontend's proxy and split routing at the ingress controller (/ → frontend, /api/ → api Service), the existing ingress.hosts[].paths list accepts both — just declare the /api/ path with a manual backend.service.name = "<release>-api" override via a strategic-merge patch or a separate Ingress.

Using an external Postgres

Point the chart at an existing database and skip the bundled subchart:

postgresql:
  enabled: false

externalDatabase:
  host: pg.internal
  port: 5432
  username: spatiumddi
  database: spatiumddi
  existingSecret: my-db-secret       # must carry key `password`
  existingSecretPasswordKey: password

Using an external Redis

redis:
  enabled: false

externalRedis:
  host: redis.internal
  port: 6379
  existingSecret: my-redis-secret    # optional; remove for unauth'd redis

Exposing DNS and DHCP to clients

The DNS and DHCP agent Services are ClusterIP unless a server sets service.type. A ClusterIP Service is reachable from inside the cluster only, which is enough for the control plane but not for clients on your LAN.

Do not point a default k3s at type: LoadBalancer for port 53. k3s ships servicelb (klipper-lb), which runs an svclb-* pod with hostPort: 53 on every node. The CNI hostPort DNAT then also captures the node's own resolver stub at 127.0.0.53:53, so the node stops resolving: image pulls fail with lookup ghcr.io: Try again, the svclb image itself cannot pull, local-path provisioning times out, and the install never converges (#3229). UDP 67 for DHCP uses the same hostPort mechanism.

Pick one of these instead:

  • MetalLB (or a cloud load balancer). Install MetalLB, start k3s with --disable servicelb so the two do not both claim the Service, and set service: { type: LoadBalancer } with the pool / address annotations shown in values.yaml. MetalLB announces a dedicated VIP, so nothing binds :53 on the node. The DNS Service takes service.annotations, service.loadBalancerIP, service.loadBalancerSourceRanges, service.externalTrafficPolicy (default Local on a LoadBalancer), service.ipFamilyPolicy and service.ipFamilies; the DHCP Service takes service.type and service.nodePort only.
  • Another LoadBalancer implementation with --disable servicelb (kube-vip, Cilium LB-IPAM, ...). The same rule applies: whatever implements the Service must not use hostPort 53.
  • NodePort, for a resolver you reach through a forwarder or an external load balancer. Port 53 is not in the NodePort range, so clients cannot use it directly.
  • hostNetwork (DHCP only in this chart). It binds the node's own port, so never run it on a node where something else, such as systemd-resolved, owns that port. DNS agents do not offer it here for exactly that reason.

On a node where only the resolver stub is the problem, never expose :53 with servicelb; if you already did, delete the Service and the svclb-* DaemonSet, then iptables -t nat -S CNI-HOSTPORT-DNAT | grep 'dports 53' should come back empty.

A LoadBalancer Service is enough for DNS. It is not enough for DHCP: client broadcasts do not reach a pod behind a Service, so DHCP needs a relay pointed at the Service address, or hostNetwork. Ports and protocols, a values example for each, and how to check the result are in the deployment guide: Exposing DNS to clients and Exposing DHCP to clients.

Running managed DNS agents

dnsAgents:
  enabled: true
  agentKey:
    existingSecret: spatium-dns-agent-key   # must carry key DNS_AGENT_KEY
  servers:
    # BIND9 (default flavor — RPZ blocklists, full views support)
    - name: ns1
      role: primary
      group: internal-resolvers
      service: { type: LoadBalancer }   # opt-in, see "Exposing DNS and DHCP to clients"
    - name: ns2
      role: secondary
      group: internal-resolvers
      service: { type: LoadBalancer }   # opt-in, see "Exposing DNS and DHCP to clients"
    # PowerDNS (issue #127 — online DNSSEC, ALIAS, LUA, catalog zones).
    # Lives in its own group so PowerDNS-only features can engage; the
    # control plane rejects mixed-driver groups for those features.
    - name: pdns1
      flavor: powerdns
      role: primary
      group: powerdns-edge
      service: { type: LoadBalancer }   # opt-in, see "Exposing DNS and DHCP to clients"
    # Technitium (third DNS driver — native DoT/DoH/DoQ listeners plus
    # encrypted upstream forwarding with no dnsdist-style sidecar; no
    # DNSSEC or catalog zones in 1.0). Own group, same rule.
    - name: tdx1
      flavor: technitium
      role: primary
      group: technitium-edge
      service: { type: LoadBalancer }   # opt-in, see "Exposing DNS and DHCP to clients"

The agent Services default to ClusterIP (#3229). The LoadBalancer lines above are opt-in and need a load balancer that does not bind port 53 on the node itself; read Exposing DNS and DHCP to clients before copying them onto k3s.

Each server picks its image from dnsAgents.image (default, configures BIND9) or dnsAgents.flavors.<flavor> per-driver override (powerdns and technitium are both pre-set out of the box). The dns-state volume mounts under /var/cache/bind for BIND9, /var/lib/powerdns for PowerDNS LMDB, and /etc/dns for Technitium's own config + zone store — same volume claim, the template picks the path based on flavor.

Pre-create the PSK secret (or use agentKey.value inline for lab use only):

kubectl -n spatiumddi create secret generic spatium-dns-agent-key \
  --from-literal=DNS_AGENT_KEY="$(openssl rand -hex 32)"

Running managed DHCP agents

Same shape as DNS but SPATIUM_AGENT_KEY:

dhcpAgents:
  enabled: true
  agentKey:
    existingSecret: spatium-dhcp-agent-key  # must carry key SPATIUM_AGENT_KEY
  servers:
    - name: dhcp1
      role: primary
      # Behind a DHCP relay (ip helper-address pointed at the Service):
      service: { type: LoadBalancer }
      # Or, on a node attached to the client VLAN, with no relay:
      # hostNetwork: true

Pick one of the two; see Exposing DHCP to clients.

GitOps with helm template (Argo CD)

Controllers that render the chart with helm template instead of installing it, such as Argo CD, need two adjustments. Flux's HelmRelease performs a real Helm install, so it needs neither.

The migrate Job. Its name carries .Release.Revision so each helm upgrade creates a fresh Job, since a Job's pod template is immutable. Under helm template the revision is always 1, so the Job is <release>-migrate-r1 on every sync, and the first image bump fails with spec.template: field is immutable until the old Job is deleted by hand. Make it a sync hook instead, so it is deleted and recreated on every sync:

migrate:
  annotations:
    argocd.argoproj.io/hook: Sync
    argocd.argoproj.io/hook-delete-policy: BeforeHookCreation

Alembic is idempotent, so re-running it on every sync is safe, and a hook no longer counts towards the application's sync status. Plain helm install / helm upgrade ignore these annotations.

Generated secrets. The chart generates its secrets on first install and keeps them across upgrades with lookup(). helm template has no cluster to look in, so lookup() returns nothing and every render generates new values. The controller then sees a changed Secret on every sync, and applying it rotates the application key and database password under a running install. Pre-create the secrets and point the chart at them:

ValueSecret must carry
auth.existingSecretsecret-key (and optionally metrics-token)
postgresql.auth.existingSecretpassword. With postgresql.kind: cnpg, the Secret must be type kubernetes.io/basic-auth with both username and password, because CNPG bootstraps the database user from it
redis.auth.existingSecretredis-password (only when redis.auth.enabled=true)
dnsAgents.agentKey.existingSecretDNS_AGENT_KEY (when dnsAgents.enabled)
dhcpAgents.agentKey.existingSecretSPATIUM_AGENT_KEY (when dhcpAgents.enabled)

Values reference

Top-level

KeyDefaultDescription
image.registryghcr.ioImage registry for control-plane images
image.repositoryspatiumddiRepo prefix (images are <registry>/<repo>/<name>)
image.tag"" → Chart.appVersionControl-plane image tag
image.pullPolicyIfNotPresent
image.pullSecrets[]
auth.secretKey""Fernet key; auto-generated on first install if empty
auth.existingSecret""BYO secret with key secret-key
fullnameOverride""
nameOverride""
global.controlPlaneNodeSelector{}Merged into every control-plane workload's nodeSelector
global.seccompProfileRuntimeDefaultPod-level seccomp for every workload. Unconfined or "" (omit) also accepted; Localhost is rejected
global.priorityClassName""PriorityClass for the control-plane workloads. Leave empty unless the class exists — the apiserver refuses a pod naming one that does not
global.servicePriorityClassName""Same, for the DNS / DHCP agent StatefulSets
<component>.priorityClassNameunsetPer-workload override. Unset inherits the chart-wide key above; "" means no class for this workload, even when the chart-wide key is set
<component>.hostUsersunset#983 — false runs the pod in a user namespace (K8s 1.36+). Refused on api/worker while api.applianceHostMounts.enabled is on
api.topologySpreadConstraints / worker.…[]#983 — replaces the defau

Deploy spatiumddi with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has spatiumddi on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartspatiumddi is pinned at v1.0.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply