Enable and disable NodeLocalDNS

The NodeLocalDNS feature is enabled and disabled through the MKE configuration file, comprehensive information for which is available at Use an MKE configuration file.

Prerequisites

Before installing the NodelocalDNS in an MKE cluster, you must verify the following settings in MKE:

  • The unmanaged CNI plugin is not enabled.

  • kube-proxy is running in iptables mode.

Note

If you are running MKE on RHEL, centOS, or Rocky Linux, review Troubleshoot NodeLocalDNS to learn of issues that NodeLocalDNS has with these operating systems and their corresponding fixes.

Enable NodeLocalDNS

To install NodelocalDNS in your MKE cluster:

  1. Modify the MKE configuration file to set the cluster_config.node_local_dns parameter to true.

    [cluster_config]
      node_local_dns = true
    
  2. Upload the modified MKE configuration file. Be aware that it may take up to five minutes for the changes to propagate through your cluster.

  3. Check for the following NodelocalDNS resources, to verify the presence of NodelocalDNS in the cluster.

    • DaemonSet

      kubectl get ds -l k8s-app=node-local-dns -n kube-system
      

      Example output:

       Result
      NAME             DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
      node-local-dns   2         2         2       2            2           <none>          79s
      
    • Service

      kubectl get svc -l k8s-app=node-local-dns -n kube-system
      

      Example output:

       Result
      NAME             TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE
      node-local-dns   ClusterIP   None         <none>        9253/TCP   100s
      
    • Pods

      kubectl get po -o wide -n kube-system -l k8s-app=node-local-dns
      

      Example output:

       Result
      NAME                   READY   STATUS    RESTARTS   AGE    IP              NODE                         NOMINATED NODE   READINESS GATES
      node-local-dns-k9gns   1/1     Running   0          116s   172.31.44.29    ubuntu-18-ubuntu-1   <none>           <none>
      node-local-dns-zskp9   1/1     Running   0          116s   172.31.32.242   ubuntu-18-ubuntu-0   <none>           <none>
      

Disable NodeLocalDNS

To uninstall NodelocalDNS:

  1. Modify the MKE configuration file to set the cluster_config.node_local_dns parameter to false.

    [cluster_config]
      node_local_dns = false
    
  2. Upload the modified MKE configuration file. Be aware that it may take up to five minutes for the changes to propagate through your cluster.

  3. Check for the following NodelocalDNS resources, to verify the presence of NodelocalDNS in the cluster.

    • DaemonSet

      kubectl get ds -l k8s-app=node-local-dns -n kube-system
      

      Example output:

      No resources found in kube-system namespace.
      
    • Service

      kubectl get svc -l k8s-app=node-local-dns -n kube-system
      

      Example output:

      No resources found in kube-system namespace.
      
    • Pods

      kubectl get po -o wide -n kube-system -l k8s-app=node-local-dns
      

      Example output:

      No resources found in kube-system namespace.