Re-vendors the coredns Helm chart from 1.43.2 to 1.46.0 (chart appVersion
1.12.3 -> 1.13.1), picking up the chart-tooling improvements (1.46 ServiceMonitor
options, 1.45 customAnnotations/dnsConfig/podLabels/dnsPolicy, 1.44 multicluster
RBAC).
This is a chart-only refresh: the running CoreDNS image is deliberately KEPT at
registry.k8s.io/coredns/coredns:v1.12.4. It is pinned to the 1.12 line that
matches the Kubernetes-bundled kube-dns replacement, and v1.12.4 is the latest
patch of that line (itself a security release). Advancing the image to the
chart's 1.13.1 appVersion (or newer) would break the deliberate alignment with
the bundled CoreDNS version and is a separate platform decision, not part of
this chart refresh. The kube-dns overrides (k8sAppLabelOverride, service.name,
serviceAccount.name) stay valid and the rendered Deployment still uses v1.12.4.
Pins the update target to --version 1.46.0 for reproducible re-vendoring.
Note: this does NOT close#2899 -- that ticket asks to advance the coredns
*image* for CVE remediation, which conflicts with the kube-dns version
alignment. Whether to move the bundled CoreDNS line forward (and thus the image)
is a platform-level call, left open on the issue.
Adaptations:
- charts/: re-vendored via make update (helm pull coredns --version 1.46.0; upstream tests dropped per the existing recipe)
- Makefile: pin update target to --version 1.46.0
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The cozystack build pipeline tags chart versions as `0.0.0+<git-sha>`.
The new coredns-custom ConfigMap interpolated `.Chart.Version` directly
into the `helm.sh/chart` label, producing `cozy-coredns-0.0.0+<sha>`
which the apiserver rejects: label values follow RFC 1123 and `+` is
not a legal character. The chart never installed, kube-system/coredns
inside tenant clusters never came up, every dependent HelmRelease
stalled, and the e2e suite hit the 2h job timeout without reaching
the bulk of the bats tests.
Apply the standard `replace "+" "_" | trunc 63 | trimSuffix "-"`
sanitization, matching the pattern the vendored upstream coredns chart
already uses in its own `helm.sh/chart` helper a few directories down.
Add a helm-unittest case that overrides the chart version to a build-
metadata form (`0.0.0+abc1234567`) and asserts the rendered label both
matches the sanitized literal and conforms to the RFC 1123 label-value
regex. Without the version override the bug is invisible to the test
suite — Chart.yaml ships the bare `0.0.0` placeholder and helm-unittest
defaults to that, so any future template that interpolates
`.Chart.Version` into a label value cannot regress past CI silently.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
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>
The Kubernetes bootstrap creates a ClusterRoleBinding 'system:kube-dns'
that references ServiceAccount 'kube-dns' in 'kube-system'. However,
the coredns chart was using the 'default' ServiceAccount because
serviceAccount.create was not enabled.
This caused CoreDNS pods to fail with 'Failed to watch' errors after
restarts, as they lacked RBAC permissions to watch the Kubernetes API.
Configure the chart to create the 'kube-dns' ServiceAccount, which
matches the expected binding from Kubernetes bootstrap.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: mattia-eleuteri <mattia@hidora.io>
Move common-envs.mk and package.mk from scripts/ to hack/ directory.
Update all Makefile includes to use new paths. Remove unused
issue-flux-certificates.sh script.
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>