quick-motherboard-78228
07/30/2026, 2:25 AM- name: Apply RKE2 CoreDNS HelmChartConfig to {{ rancher_clustername }} cluster and enable NodeLocalDNS
kubernetes.core.k8s:
state: present
validate_certs: "{{ K8S_AUTH_API_SSL_VERIFY }}"
definition:
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: rke2-coredns
namespace: kube-system
spec:
valuesContent: |-
nodelocal:
enabled: true
# ---- CoreDNS Deployment settings ----
priorityClassName: system-cluster-critical
resources:
limits:
cpu: 300m
memory: 300Mi
requests:
cpu: 100m
memory: 128Mi
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/worker
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values: ["kube-dns"]
# ---- Corefile via structured servers (replaces the Corefile) ----
servers:
- port: 53
zones:
- zone: .
plugins:
- name: errors
- name: template ANY AAAA
configBlock: |-
rcode NOERROR
- name: health
configBlock: |-
lameduck 5s
- name: ready
- name: kubernetes
parameters: in-addr.arpa ip6.arpa
configBlock: |-
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
- name: prometheus
parameters: :9153
- name: forward
parameters: . /etc/resolv.conf
- name: cache
parameters: "30"
- name: loop
- name: reload
- name: loadbalance
# ---- CoreDNS Autoscaler ----
autoscaler:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/worker
operator: Exists
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values: ["kube-dns-autoscaler"]
priorityClassName: system-cluster-critical
enabled: true
coresPerReplica: 128
nodesPerReplica: 4
preventSinglePointFailure: true
includeUnschedulableNodes: false
min: 2
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 25m
memory: 16Micreamy-pencil-82913
07/30/2026, 2:34 AMcreamy-pencil-82913
07/30/2026, 2:36 AMquick-motherboard-78228
07/30/2026, 3:54 PMtemplate ANY AAAA {
rcode NOERROR
}
This allows NodeLocal DNS to immediately return an empty NOERROR response for IPv6 (AAAA) queries in our IPv4-only clusters, avoiding unnecessary upstream forwarding. Is there a supported way to customize the generated NodeLocal Corefile?
below is default node-local configmap
❯ kubectl get cm node-local-dns -n kube-system \
-o go-template='{{index .data "Corefile"}}'
cluster.local:53 {
errors
cache {
success 9984 30
denial 9984 5
}
reload
loop
bind 169.254.20.10 100.66.0.10
forward . __PILLAR__CLUSTER__DNS__ {
force_tcp
}
prometheus :9253
health 169.254.20.10:8080
}
in-addr.arpa:53 {
errors
cache 30
reload
loop
bind 169.254.20.10 100.66.0.10
forward . __PILLAR__CLUSTER__DNS__ {
force_tcp
}
prometheus :9253
}
ip6.arpa:53 {
errors
cache 30
reload
loop
bind 169.254.20.10 100.66.0.10
forward . __PILLAR__CLUSTER__DNS__ {
force_tcp
}
prometheus :9253
}
.:53 {
errors
cache 30
reload
loop
bind 169.254.20.10 100.66.0.10
forward . __PILLAR__UPSTREAM__SERVERS__
prometheus :9253
}
~/Downloads/kube
github.com/rancher/rke2-charts/blob/…/values.yaml#…quick-motherboard-78228
08/01/2026, 5:30 PMquick-motherboard-78228
08/01/2026, 5:31 PM