Use this file to discover all available pages before exploring further.
To improve the DNS performance in a Managed Service for Kubernetes cluster, you can use the NodeLocal DNSCache feature. With this feature, a DNS caching agent runs on each cluster node to resolve DNS requests locally on the same nodes as the pods.In this tutorial, you will learn to configure a NodeLocal DNSCache for the Cilium network policy controller by using local redirect policy.
Prepare manifests for NodeLocal DNSCache and local redirect policy
Retrieve the service IP address for coredns:
kubectl get svc coredns -n kube-system -o jsonpath={.spec.clusterIP}
Create a manifest file named node-local-dns.yaml. In the DaemonSet specification (spec.template.spec.containers.args), replace the coredns_IP_address with the IP address of the coredns service you obtained in the previous step.
# HELP coredns_dns_requests_total Counter of DNS requests made per zone, protocol and family.# TYPE coredns_dns_requests_total countercoredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="cluster.local."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="in-addr.arpa."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="ip6.arpa."} 1
The values of the metrics should increase, for example:
# HELP coredns_dns_requests_total Counter of DNS requests made per zone, protocol and family.# TYPE coredns_dns_requests_total countercoredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="A",view="",zone="."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="A",view="",zone="cluster.local."} 6coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="AAAA",view="",zone="."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="AAAA",view="",zone="cluster.local."} 2coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="cluster.local."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="in-addr.arpa."} 1coredns_dns_requests_total{family="1",proto="udp",server="dns://0.0.0.0:53",type="other",view="",zone="ip6.arpa."} 1
If the tests don’t show the expected metrics increase, there may be an error in your configuration.
The Managed Kubernetes cluster you used in this tutorial is chargeable. If you do not need it, delete this resource, so Nebius AI Cloud does not charge for it.