node-local-dns

by Delivery Hero

Helm chartv2.9.4App 1.27.1Verified publisher

A chart to install node-local-dns. NodeLocal DNSCache improves Cluster DNS performance by running a DNS caching agent on cluster nodes as a DaemonSet. In today's architecture, Pods in 'ClusterFirst' DNS mode reach out to a kube-dns serviceIP for DNS queries. This is translated to a kube-dns/CoreDNS endpoint via iptables rules added by kube-proxy. With this new architecture, Pods will reach out to the DNS caching agent running on the same node, thereby avoiding iptables DNAT rules and connection tracking. The local caching agent will query kube-dns service for cache misses of cluster hostnames ("cluster.local" suffix by default). Further documentation is [here](https://kubernetes.io/docs/tasks/administer-cluster/nodelocaldns/) This helm chart works for both kube-proxy setups (iptables or ipvs).

About this chart

node-local-dns

A chart to install node-local-dns.

NodeLocal DNSCache improves Cluster DNS performance by running a DNS caching agent on cluster nodes as a DaemonSet.

In today's architecture, Pods in 'ClusterFirst' DNS mode reach out to a kube-dns serviceIP for DNS queries. This is translated to a kube-dns/CoreDNS endpoint via iptables rules added by kube-proxy. With this new architecture, Pods will reach out to the DNS caching agent running on the same node, thereby avoiding iptables DNAT rules and connection tracking. The local caching agent will query kube-dns service for cache misses of cluster hostnames ("cluster.local" suffix by default).

Further documentation is here

This helm chart works for both kube-proxy setups (iptables or ipvs).

How to install this chart

A simple install with default values, latest chart version and generated name:

helm install --generate-name oci://ghcr.io/deliveryhero/helm-charts/node-local-dns

To install a specific version of this chart:

helm install --generate-name oci://ghcr.io/deliveryhero/helm-charts/node-local-dns --version 2.9.4

To install the chart with the release name my-release:

helm install my-release oci://ghcr.io/deliveryhero/helm-charts/node-local-dns

To install with some set values:

helm install my-release oci://ghcr.io/deliveryhero/helm-charts/node-local-dns --set values_key1=value1 --set values_key2=value2

To install with custom values file:

helm install my-release oci://ghcr.io/deliveryhero/helm-charts/node-local-dns -f values.yaml

Values

KeyTypeDefaultDescription
affinityobject{}
config.bindIpboolfalseIf false, it will bind 0.0.0.0, otherwise dnsServer and localDns will be used. https://github.com/bottlerocket-os/bottlerocket/issues/3711#issuecomment-1907087528
config.cacheTTLint30Cache TTL in seconds for DNS records. https://coredns.io/plugins/cache/
config.commProtocolstring"force_tcp"Set communication protocol. Options are prefer_udp or force_tcp
config.customConfigstring""Overrides the generated configuration with specified one.
config.customUpstreamsvcstring""Use a custom upstreamsvc for -upstreamsvc
config.dnsDomainstring"cluster.local"Internal k8s DNS domain
config.dnsServerstring"172.20.0.10"Main coredns service (kube-dns) ip, used on iptables-mode.
config.enableLoggingboolfalseSet boolean to log DNS requests
config.extraServerBlocksstring""Add extra server blocks to the generated configuration.
config.healthPortint8080Port used for the health endpoint
config.localDnsstring"169.254.20.25"
config.noIPv6LookupsboolfalseIf true, return NOERROR when attempting to resolve an IPv6 address
config.port.numberint53Port used for DNS traffic
config.port.tcpstring"dns-tcp"Port name used for TCP DNS traffic
config.port.udpstring"dns"Port name used for UDP DNS traffic
config.prefetchobject{"amount":3,"duration":"30s","enabled":false,"percentage":"20%"}If enabled, coredns will prefetch popular items when they are about to be expunged from the cache. https://coredns.io/plugins/cache/
config.serveStaleobject{"duration":"1h","enabled":false,"mode":"verify"}If enabled, coredns will serve stale cache entries while fetching fresh ones in the background. https://coredns.io/plugins/cache/
config.setupInterfacebooltrue
config.setupIptablesbooltrue
config.skipTeardownboolfalse
config.upstreamForwardConfigobject{}Allows for configuration of upstream server forwarding for the default server block
config.upstreamServersstring"__PILLAR__UPSTREAM__SERVERS__"Overrides the upstream servers used for default server block
config.upstreamServiceSelectorobject{"k8s-app":"kube-dns"}Use a custom upstream service selector
configMapAnnotationsobject{}
configMapLabelsobject{}
daemonsetAnnotationsobject{}
daemonsetLabelsobject{}
dashboardobject{"annotations":{},"enabled":false,"label":"grafana_dashboard","namespace":"kube-system"}https://github.com/grafana/helm-charts/blob/main/charts/grafana/README.md
dashboard.labelstring"grafana_dashboard"label that grafana sidecar is configured to look for
dashboard.namespacestring"kube-system"namespace where grafana sidecar is configured to look for dashboards. e.g. "monitoring"
fullnameOverridestring""
image.repositorystring"registry.k8s.io/dns/k8s-dns-node-cache"
image.tagstring""Overrides the image tag whose default is the chart appVersion.
imagePullSecretslist[]
initContainerslist[]
lifecycleobject{}Container lifecycle hooks for the node-cache pod.
nameOverridestring""
podAnnotationsobject{}
podLabelsobject{}
prometheusScraping.enabledbooltrue
resizePolicylist[]Resize policy for in-place pod vertical scaling. Container resize policies
resources.limits.memorystring"128Mi"
resources.requests.cpustring"25m"
resources.requests.memorystring"128Mi"
securityContext.capabilities.add[0]string"NET_ADMIN"
service.annotationsobject{}Annotations to add to the service.
serviceAccount.annotationsobject{}Annotations to add to the service account.
serviceAccount.createbooltrueSpecifies whether a service account should be created.
serviceAccount.namestring""If not set and create is true, a name is generated using the fullname template.
serviceMonitorobject{"enabled":false,"honorLabels":false,"labels":{},"metricRelabelings":[],"namePrefix":"","path":"/metrics","prometheusNamespace":"kube-system","relabelings":[]}https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/developer/getting-started.md
serviceMonitor.enabledboolfalseEnsure that servicemonitor is created, this will disable prometheus annotations
serviceMonitor.metricRelabelingslist[]Metric relabel configs to apply to samples before ingestion. Metric Relabeling
serviceMonitor.namePrefixstring""The service monitor name prefix which align with the prometheus operator name, eg.: kube-prometheus-stack
serviceMonitor.prometheusNamespacestring"kube-system"The namespace of prometheus where the service monitor should be deployed
serviceMonitor.relabelingslist[]Relabel configs to apply to samples before ingestion. Relabeling
tolerations[0].keystring"CriticalAddonsOnly"
tolerations[0].operatorstring"Exists"
tolerations[1].effectstring"NoExecute"
tolerations[1].operatorstring"Exists"
tolerations[2].effectstring"NoSchedule"
tolerations[2].operatorstring"Exists"
updateStrategyobject{"rollingUpdate":{"maxUnavailable":"10%"},"type":"RollingUpdate"}DaemonSet update strategy configuration

Maintainers

NameEmailUrl
gabrieladthttps://github.com/gabrieladt

Chart source and versions

Chart source: github.com/deliveryhero/helm-charts/node-local-dns

Older chart versions: github.com/deliveryhero/helm-charts/pkgs/container/helm-charts/node-local-dns

Deploy node-local-dns with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has node-local-dns 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 chartnode-local-dns is pinned at v2.9.4 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