Deploy NetBox (CNPG Postgres, Valkey, Authentik SSO) #299
Reference in New Issue
Block a user
Delete Branch "benvin/netbox"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
NetBox becomes the source of truth for host/interface/IPAM data as part of retiring Cobbler. The ENC role already moved to encapi; a kickstart-generation microservice that consumes NetBox comes later and is intentionally out of scope here.
Change
Adds the
netboxapp (namespacenetbox, platform project) using the netbox-community helm chart via the OCI helm-through-kustomize pattern, plus estate-native data stores:8.3.40(appVersionv4.6.5),oci://ghcr.io/netbox-community/netbox-chart. 2 web replicas, 1 worker; bundled Postgres/Valkey subcharts disabled. Media on RWX CephFS so replicas share uploads. Charthelm.sh/hook: testPod dropped via a kustomize delete patch (we deploy through ArgoCD, nothelm test).netbox-postgres, 2 instances, PG 18,cephrbd-fast-delete. Standard per-cluster S3 backup:barmanObjectStore -> s3://cnpg-netbox, cephrgwObjectStoreUser+Bucket, nightlyScheduledBackupat 03:40 (0 40 3 * * *— next free slot after grafana's 03:20), 30d retention. A pgbouncerPooler(session mode) fronts it; NetBox connects vianetbox-postgres-pooler-rw.valkey/valkey:8-alpine), AOF-persistent PVC oncephrbd-fast-delete. One instance: DB 0 = RQ task queue, DB 1 = cache. No auth (in-cluster, namespace-isolated). Chosen over the bundled Bitnami subchart to keep image control in-estate and avoid Bitnami's legacy-image churn; mirrors the litellm standalone-cache pattern.Gateway+HTTPRouteatnetbox.k8s.syd1.au.unkin.net(traefik-internal,vault-issuercert intonetbox-tls, external-dns to the internal VIP), HTTP->HTTPS 301.VaultStaticSecret(postgres-credentials,netbox-secret-key,netbox-superuser,oauth-credentials); no plain Secrets committed. The shareddefaultk8s-auth role already binds*namespaces with a namespace-templated KV policy, so no terraform-vault change is needed.remoteAuthwiresREMOTE_AUTH_ENABLED+ theOpenIdConnectAuthbackend via chart values;SOCIAL_AUTH_OIDC_*viaextraConfig(the chart's config loader globs/run/config/extra/*/*.yaml). The client secret is injected as a YAML fragment mounted from the Vault-syncedoauth-credentialssecret. New users auto-provision on first login.netboxin the platform ApplicationSet and AppProject (destination namespace + chart sourceRepo).Image table (source -> artifactapi -> DHI decision)
All images flow through the estate's containerd registry mirrors; the allowlist patterns gate them. DHI (Docker Hardened Images) require authenticated pulls from a Docker Hub
dhi/org and are not reachable through the anonymous mirror, so upstream official is used throughout.ghcr.io/netbox-community/netbox:v4.6.5^netbox-community/ghcr.io/cloudnative-pg/postgresql:18.1-system-trixie^cloudnative-pg/docker.io/valkey/valkey:8-alpine^valkey/valkeydocker.io/busybox:1.38.0^library/busyboxdocker.io/rancher/kubectl:v1.36.2^rancher/Cross-repo PRs (merge order)
^netbox-community/ghcr allowlist) — merge before this PR so the NetBox image pulls on first sync.One-time Vault seeds (before/at first sync)
Seed
oauth-credentialsbefore applying terraform-authentik #11 (that apply readsclient_secret).Validation
kustomize build --enable-helm apps/overlays/au-syd1/netbox— clean.kubeconform(CI args, k8s 1.33.7): 27/27 valid, 0 invalid.pre-commit(yamllint + no-plain-secrets) on all changed files — pass.Out of scope
The PXE/kickstart microservice that will consume NetBox — not scaffolded here.
https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv
Note: the four Vault seeds listed as manual prerequisites (
postgres-credentials,netbox-secret-key,netbox-superuser,oauth-credentialsunderkv/kubernetes/namespace/netbox/default/) are already written and verified (all present at v1). No manual Vault steps remain for this PR — merge order is just terraform-artifactapi #17 first for the image allowlist.