powerdns
by unxwares-sac
PowerDNS Authoritative Server with its REST API, SQLite/PostgreSQL/MySQL backends and an optional PowerDNS Recursor, hardened for Kubernetes.
About this chart
PowerDNS Helm Chart
PowerDNS Authoritative Server serves DNS zones stored in a database and manages them through a REST API. This chart deploys it on Kubernetes with a SQLite, PostgreSQL or MySQL/MariaDB backend and, optionally, a PowerDNS Recursor that resolves names for your clients and sends your own zones to the authoritative server. The chart is maintained by UnxWares and runs the UnxWares builds of PowerDNS by default.
Features
- UnxWares images by default: PowerDNS built from the release tarballs on current Alpine bases, and the database
clients alone for the schema init, rebuilt twice a week; the official images stay available with
imageProvider: upstream(see Images). - Authoritative DNS with DNSSEC, on SQLite (single replica + PVC), PostgreSQL or MySQL/MariaDB (scale out).
- Automatic schema creation: the schema shipped in the PowerDNS image is applied when the database is empty (idempotent init container).
- REST API for ExternalDNS, PowerDNS-Admin, cert-manager webhooks... The API key is generated and kept across upgrades, or read from your own Secret.
- Optional Recursor that forwards your zones to the authoritative server and resolves everything else, with DNSSEC validation and negative trust anchors for your internal zones.
- Hardened by default: non-root (uid 953), read-only root filesystem, every capability dropped, seccomp
RuntimeDefault, no service account token. DNS listens on an unprivileged port inside the pod and the Service exposes it on 53. - Secrets never land in ConfigMaps: they are injected as environment variables and rendered at startup into a memory-backed volume.
- Prometheus
/metricswith optional ServiceMonitors, NetworkPolicy isolating the API, PodDisruptionBudget, HPA (SQL backends), topology spread.
Architecture
With a release named dns, the resources are called dns-powerdns (or just the release name when it already
contains powerdns). This is <fullname> below.
| Resource | Name | Created when | Content |
|---|---|---|---|
| Deployment | <fullname> | always | container pdns (authoritative server); init containers below |
| Service | <fullname> | always | DNS: dns-udp and dns-tcp on service.port (53), to dns.containerPort (1053) in the pod |
| Service | <fullname>-api | webserver.enabled (default) | http on apiService.port (8081): REST API and /metrics |
| ConfigMap | <fullname> | always | pdns.conf and secrets.j2, the template of the secret settings (no secret in it) |
| Secret | <fullname> | the API key or a database password is managed by the chart | api-key (generated, or api.key), db-password (inline backend.<type>.password); annotated helm.sh/resource-policy: keep when the key is generated |
| PersistentVolumeClaim | <fullname> | gsqlite3 backend, persistence.enabled (default), no persistence.existingClaim | the SQLite database, annotated helm.sh/resource-policy: keep |
| ServiceAccount | <fullname> | serviceAccount.create (default) | shared by the server and the recursor, token not mounted |
| Deployment, Service, ConfigMap | <fullname>-recursor | recursor.enabled | container recursor; Service with DNS on recursor.service.port (53), nothing else; ConfigMap recursor.j2 (the recursor YAML settings) |
| Service | <fullname>-recursor-api | recursor.enabled and recursor.webserver.enabled (default) | http on recursor.webserver.port (8082): recursor API and /metrics, always ClusterIP |
| HorizontalPodAutoscaler | <fullname>, <fullname>-recursor | autoscaling.enabled, recursor.autoscaling.enabled | CPU target (and memory target for the server, with autoscaling.targetMemoryUtilizationPercentage) |
| PodDisruptionBudget | <fullname>, <fullname>-recursor | podDisruptionBudget.enabled, recursor.podDisruptionBudget.enabled | minAvailable, or maxUnavailable when set |
| NetworkPolicy | <fullname>, <fullname>-recursor | networkPolicy.enabled (the second one with recursor.enabled) | ingress: DNS open, http restricted |
| ServiceMonitor | <fullname>, <fullname>-recursor | metrics.serviceMonitor.enabled, recursor.metrics.serviceMonitor.enabled, the webserver, and the monitoring.coreos.com/v1 CRD | scrapes /metrics |
Pod (helm test) | <fullname>-test-api | api.enabled and webserver.enabled | see Testing |
Init containers of the authoritative server:
| Backend | Init containers | What they do |
|---|---|---|
gsqlite3 | sqlite-init (PowerDNS image) | creates the SQLite database from the image schema when the file is missing or empty |
gpgsql, gmysql with backend.schemaInit.enabled (default) | copy-schema (PowerDNS image), then schema-init (PostgreSQL or MySQL client image) | copies the schema of the server version, waits for the database (backend.schemaInit.timeoutSeconds), creates the schema when the domains table is missing |
schema-init gets the database password only (not the API key), mounts extraVolumeMounts like the server (a CA
for sslrootcert, for example), and has its own memory-backed /tmp (1Mi), where the MySQL client reads its
options file.
Volumes of the pdns container: the ConfigMap (/etc/powerdns/pdns.conf and
/etc/powerdns/templates.d/secrets.j2, read-only); /etc/powerdns/pdns.d, a memory-backed emptyDir (1Mi) that holds
secrets.conf, rendered at startup; /run/pdns (control socket, 1Mi) and /tmp (16Mi) emptyDirs; with gsqlite3,
the data volume (the PVC, or an emptyDir without persistence) mounted on the directory of
backend.gsqlite3.database. The recursor mounts its ConfigMap template, /etc/powerdns/recursor.d (where its startup
script writes recursor.yml), /run/pdns-recursor and /tmp, all emptyDirs.
The image startup script renders the Jinja2 templates of /etc/powerdns/templates.d listed in TEMPLATE_FILES
from environment variables: this is how the API key and the database password reach the configuration without being
stored in a ConfigMap, and how the recursor learns the address of the authoritative Service.
Images
| Component | imageProvider: unxwares (default) | imageProvider: upstream |
|---|---|---|
| Authoritative server | ghcr.io/unxwares/pdns-auth | docker.io/powerdns/pdns-auth-51 |
Recursor (recursor.enabled) | ghcr.io/unxwares/pdns-recursor | docker.io/powerdns/pdns-recursor-54 |
| PostgreSQL client of the gpgsql schema init | ghcr.io/unxwares/postgresql-client:18 | docker.io/library/postgres:18.6-alpine |
| MySQL client of the gmysql schema init | ghcr.io/unxwares/mysql-client:8.4 | docker.io/library/mysql:8.4.13 |
Tags: the authoritative server follows the chart appVersion (image.tag), the recursor recursor.image.tag
(5.4.9, required unless recursor.image.digest is set); the client images are whole references
(backend.schemaInit.postgresImage, backend.schemaInit.mysqlImage). The UnxWares client images hold the client
alone, not a database server: 18 and 8.4 take the latest client of the series at each rebuild. The helm test pod
uses the authoritative server image, or tests.image.
The UnxWares images are the same PowerDNS versions, built from the release tarballs on current Alpine bases and
rebuilt twice a week (Monday and Thursday), with the backends the chart supports (bind, gsqlite3, gpgsql, gmysql) and
without the tools of the Debian images (vim, curl...). They keep the pdns user (uid 953), the paths, the ports and
the startup script that renders /etc/powerdns/templates.d, so the chart configures both image sets the same way.
They are built for linux/amd64 and linux/arm64. Sources:
images/.
imageProvider only fills the values left empty: image.repository, recursor.image.repository,
backend.schemaInit.postgresImage and backend.schemaInit.mysqlImage override it for one component.
imageProvider: upstream
To pin an image: the UnxWares images also have one immutable tag per build (<version>-<YYYYMMDD>), and every image
value accepts a digest, which takes precedence over the tag.
image:
tag: "5.1.5-20261102"
recursor:
image:
digest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef # your digest
backend:
schemaInit:
postgresImage: ghcr.io/unxwares/postgresql-client:18-20261102
Every UnxWares tag is signed with cosign (keyless, by the image workflow of the repository). To verify an image:
cosign verify ghcr.io/unxwares/pdns-auth:5.1.5 \
--certificate-identity 'https://github.com/UnxWares/helm/.github/workflows/images.yaml@refs/heads/main' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
A default install runs the authoritative server image only. The recursor and the PostgreSQL/MySQL client images of the schema init are only pulled when enabled; the Artifact Hub security report covers the default image. Known vulnerabilities of every image the chart can deploy, upstream images included, are tracked in the CVE watch issue.
Requirements
Kubernetes: >=1.27.0-0
- Kubernetes 1.27 to 1.29: supported; the preStop hooks (see
Shutdown and rolling updates) run
sleepfrom the image there, and use thesleeplifecycle action from 1.30, where that action is enabled by default. - Node architecture:
linux/amd64orlinux/arm64(all default images are multi-architecture). - Storage: the default
gsqlite3backend asks for a 1GiReadWriteOncePVC from the default StorageClass (orpersistence.storageClass, orpersistence.existingClaim). The SQL backends need no volume. - Database (
gpgsql,gmysql): an existing PostgreSQL or MySQL/MariaDB database and user, reachable from the pods. The chart does not deploy one. Withbackend.schemaInit.enabled, the user needs the right to create tables. - Exposure outside the cluster: DNS is UDP and TCP, not HTTP, so there is no Ingress or Gateway API route. Use a
LoadBalancerService that supports UDP and a Service mixing UDP and TCP on the same port, or aNodePortService. The chart creates no Ingress for the API either. - IPv6: the default listen addresses include
[::](::for the recursor); remove them where pods have no IPv6. - Optional: the Prometheus Operator CRDs for the ServiceMonitors, metrics-server for the
HorizontalPodAutoscalers, and a CNI that enforces NetworkPolicies for
networkPolicy.enabled.
Installation
helm repo add unxwares https://helm.unxwares.studio
helm repo update
helm install dns unxwares/powerdns --namespace dns --create-namespace
Charts are signed with the UnxWares Helm Charts OpenPGP key (fingerprint
7902 E52E A435 EF27 C643 2E53 78D6 B532 C599 DA9B, public key https://helm.unxwares.studio/pgp-public-key.asc).
To verify the package before installing it:
curl -fsSL https://helm.unxwares.studio/pgp-public-key.asc | gpg --import
gpg --export 7902E52EA435EF27C6432E5378D6B532C599DA9B > ~/.gnupg/unxwares-helm.gpg
helm install dns unxwares/powerdns --namespace dns --create-namespace --verify --keyring ~/.gnupg/unxwares-helm.gpg
See also verifying signatures.
The defaults give a working server: SQLite on a PVC, the API enabled with a generated key, DNS on a ClusterIP
Service. For a real install, set at least the SOA used for new zones, and choose how DNS is exposed
(DNS service) and which database to use
(Database backends):
config:
default-soa-content: ns1.example.com. hostmaster.@ 0 10800 3600 604800 3600
After the install, read the API key, create a zone through the API and query it. A port-forward reaches the API from
127.0.0.1, which webserver.allowFrom accepts; it only carries TCP, hence dig +tcp:
API_KEY=$(kubectl get secret -n dns dns-powerdns -o jsonpath='{.data.api-key}' | base64 -d)
kubectl port-forward -n dns svc/dns-powerdns-api 8081:8081 &
curl -s -H "X-API-Key: $API_KEY" http://127.0.0.1:8081/api/v1/servers/localhost
curl -s -H "X-API-Key: $API_KEY" -X POST http://127.0.0.1:8081/api/v1/servers/localhost/zones \
-d '{"name": "example.com.", "kind": "Native", "nameservers": ["ns1.example.com."]}'
curl -s -H "X-API-Key: $API_KEY" -X PATCH http://127.0.0.1:8081/api/v1/servers/localhost/zones/example.com. \
-d '{"rrsets": [{"name": "www.example.com.", "type": "A", "ttl": 300, "changetype": "REPLACE",
"records": [{"content": "192.0.2.10", "disabled": false}]}]}'
kubectl port-forward -n dns svc/dns-powerdns 5353:53 &
dig +tcp -p 5353 @127.0.0.1 www.example.com
Pods of the cluster reach DNS at dns-powerdns.dns.svc (port 53) and the API at
http://dns-powerdns-api.dns.svc:8081/api/v1.
Configuration
Database backends
backend.type selects the backend: gsqlite3 (default), gpgsql or gmysql. backend.dnssec (default true)
stores DNSSEC keys and metadata in the database. The chart refuses to render an in
Deploy powerdns with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has powerdns 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpowerdns is pinned at v2026.11.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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