Open
Conversation
…Corefile Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
…rom PR Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
5e00e49 to
4552a05
Compare
…liases Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
kyteinsky
approved these changes
Apr 15, 2026
Contributor
kyteinsky
left a comment
There was a problem hiding this comment.
works with kind ✔️
docs would need updates too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EDITED: Started out as a fix for a CoreDNS crashloop that hit us on k3s , but after investigating and trying two approaches, the cleanest answer turned out to be "just remove the whole cluster-wide DNS patcher" as
coredns-customis a k3s/RKE convention. It is not universal.To restore the state of system how it would be after this PR is merged, it is required to:
for k3s:
kubectl delete configmap coredns-custom -n kube-system --ignore-not-foundkubectl delete configmap coredns -n kube-systemkubectl rollout restart deployment coredns -n kube-systemkubectl get configmap coredns -n kube-system -o jsonpath='{.data.Corefile}' | grep -c nextcloud- should print0for kind:
kubectl delete configmap coredns-custom -n kube-system --ignore-not-foundkubectl rollout restart deployment coredns -n kube-systemkubectl rollout status deployment coredns -n kube-system --timeout=60sCoreDNS host-alias patching was broken on k3s
_k8s_ensure_coredns_host_aliasespatches the maincorednsConfigMap in kube-system to makeHP_K8S_HOST_ALIASESresolve cluster-wide. The regexhosts\s*\{[^}]*\}only matches the argumentless form of thehostsplugin - k3s ships withhosts /etc/coredns/NodeHosts { ... }, which the regex misses. HaRP then falls through to the "insert beforeforward ." branch and appends a secondhosts {}block inside the same server block.Fix: stop writing to the operator-owned
corednsConfigMap entirely. Write a standalone.serverfile intokube-system/coredns-custominstead - that's the ConfigMap k3s's CoreDNS Deployment already mounts at/etc/coredns/custom/(optional: true) and imports viaimport /etc/coredns/custom/*.server. Each alias becomes its own zone with a smallhosts { ... }block, so there's no way to collide with any plugin in the main server block.CI: deploy workflows copied from AppAPI