Files
Aleksei Sviridkin 9f8e7f9d4a feat(coredns): import /etc/coredns/custom into the Corefile
Extends the cozystack-coredns wrapper with the standard CoreDNS
`import /etc/coredns/custom/*.override` directive in the .:53 server
block and renders an empty kube-system/coredns-custom ConfigMap as
a chart-managed prerequisite, mounted into the CoreDNS Deployment
at /etc/coredns/custom/ via extraVolumes / extraVolumeMounts. The
ConfigMap carries helm.sh/resource-policy: keep so the chart-managed
empty value cannot strip what later writers add into it.

This exposes a stable extension point on the cozystack CoreDNS for
operators (or other cozystack components) that need to add plugin-only
rewrite snippets without touching the chart-rendered Corefile —
otherwise the chart would re-template data.Corefile on every Flux
reconcile and overwrite the additions.

The same package serves both host and tenant CoreDNS deployments, so
this plumbing covers both layers without per-layer duplication. The
volume mount is `optional: true` for defence-in-depth: a future chart
upgrade that drops the templates/coredns-custom.yaml render still
leaves CoreDNS healthy with no override snippets in play.

helm-unittest fixtures pin the ConfigMap shape (name, namespace, keep
annotation, no data), the `import` directive in the rendered Corefile,
the presence of the `reload` plugin (required for live ConfigMap
updates), and the volume + volumeMount on the CoreDNS Deployment.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
2026-05-06 06:37:52 +03:00

20 lines
614 B
Makefile

export NAME=coredns
export NAMESPACE=kube-system
include ../../../hack/package.mk
test:
helm unittest .
update:
rm -rf charts
helm repo add cozy-coredns https://coredns.github.io/helm
helm repo update cozy-coredns
helm pull cozy-coredns/coredns --untar --untardir charts
# Drop vendored upstream helm-unittest fixtures: they hard-code
# upstream defaults (test-release-coredns names, no
# k8sAppLabelOverride, no service.name override) and fail under
# the cozystack values.yaml that pins kube-dns. The cozystack-side
# fixtures in tests/ are the only ones CI should run.
rm -rf charts/coredns/tests