coredns

by QuenchWorks

Helm chartv0.0.23App 1.14.7Apache-2.0Verified publisher

Fast, flexible DNS server that chains plugins to serve DNS and service discovery, the default cluster DNS for Kubernetes. Hardened by QuenchWorks as a minimal, nonroot, CVE-gated image, cosign-signed and pinned by digest.

About this chart

Quenchworks CoreDNS

Hardened CoreDNS, the plugin-chained DNS server and default cluster DNS for Kubernetes, on a minimal, nonroot, CVE-gated image built from source and pinned by digest. It runs as a stateless Deployment and serves DNS on port 53 (UDP and TCP), on a read-only root filesystem with all capabilities dropped. The image is cosign-signed (keyless / Sigstore) and the chart pins it by the signed digest, never a tag.

Install

helm install dns oci://ghcr.io/quenchworks/charts/coredns

The server runs nonroot, so it binds DNS on the unprivileged port 1053; the Service maps 53 (UDP and TCP) to it. Resolve a name from a client pod:

kubectl run dnsutils --rm -it --restart=Never --image=ghcr.io/quenchworks/images/busybox -- \
  nslookup quench-works.com dns-coredns

Verify the image

cosign verify ghcr.io/quenchworks/images/coredns \
  --certificate-identity-regexp 'https://github.com/quenchworks/.+' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Each build also ships an SPDX SBOM and SLSA provenance attestation. Verify them with gh attestation verify oci://ghcr.io/quenchworks/images/coredns --owner quenchworks.

Values

KeyDefaultNotes
image.repositoryghcr.io/quenchworks/images/coredns
image.digest(CI-written)Required. Charts pin by digest, never a tag.
image.pullPolicyIfNotPresentAlways, IfNotPresent, or Never.
nameOverride""Override the chart name in resource names.
replicaCount1Stateless Deployment (ignored when autoscaling is on).
config.corefilehealth/ready/whoami/forward/cacheThe Corefile, mounted over /etc/coredns/Corefile.
config.existingConfigMap""Use your own ConfigMap (key Corefile) instead; wins over corefile.
resources.requestscpu 50m / mem 32Mi
resources.limitscpu 250m / mem 128Mi
service.typeClusterIPClusterIP, NodePort, or LoadBalancer.
service.port53DNS Service port (maps 53 -> container 1053).
service.tlsPort853DNS over TLS (pod 1853), only with tls.enabled
tls.enabledfalseDNS over TLS on 1853 beside plain DNS (cert at /tls); the chart appends a tls:// block forwarding to the plain block on 1053
tls.existingSecret""a kubernetes.io/tls Secret to use (1st choice)
tls.certManager.enabledfalserequest a cert-manager Certificate from tls.certManager.issuerRef (2nd choice)
tls.selfSigned.validityDays365otherwise Helm generates a CA + certificate, kept across upgrades
autoscaling.enabledfalseHPA on CPU (autoscaling/v2).
autoscaling.minReplicas1
autoscaling.maxReplicas5
autoscaling.targetCPUUtilizationPercentage80
serviceAccount.createtrueToken automount is off.
serviceAccount.name""Use an existing ServiceAccount.
rbac.createfalseMinimal Role/RoleBinding.
networkPolicy.enabledtrueRestricts ingress.
networkPolicy.allowExternaltrueSet false to restrict ingress to the release namespace. DNS is usually queried cluster-wide, so this defaults open.
podDisruptionBudget.enabledtrueminAvailable: 1.

Plus the shared quench-common knobs (scheduling, probes, sidecars, init containers, extra env/volumes, security contexts, update strategy).

Architecture

A stateless Deployment runs CoreDNS behind a DNS Service. The container binds the unprivileged port 1053 so it runs nonroot with no added capabilities, and the Service maps 53 (UDP and TCP) to it. CoreDNS is configured by a Corefile: the chart renders config.corefile to a ConfigMap and mounts it over the image's -conf path at /etc/coredns/Corefile. The default Corefile serves health (:8080) and ready (:8181), which back the liveness and readiness probes, answers with whoami, and forwards everything else to the node resolvers with a 30s cache. The root filesystem is read-only; there is no persistence, and the workload scales horizontally with autoscaling or replicaCount.

Configuration examples

Point the forwarder at explicit upstreams and enable autoscaling:

config:
  corefile: |
    .:1053 {
        health :8080
        ready :8181
        forward . 1.1.1.1 8.8.8.8
        cache 30
        log
        errors
    }
autoscaling:
  enabled: true
  maxReplicas: 8

Bring your own Corefile ConfigMap (managed outside the chart, key Corefile):

config:
  existingConfigMap: my-corefile

To bind the privileged port 53 inside the container instead, grant NET_BIND_SERVICE via containerSecurityContext.capabilities.add and set the Corefile to listen on .:53.

Uninstall

helm uninstall dns

Nothing persists: the workload is stateless and holds no PVCs.

Notes

The chart depends on the quench-common library chart, pulled from oci://ghcr.io/quenchworks/charts/quench-common. The container runs as nonroot on a read-only root filesystem with all capabilities dropped, and the image is pinned by digest.

Deploy coredns with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has coredns 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 chartcoredns is pinned at v0.0.23 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