https://rancher.com/ logo
Title
m

miniature-advantage-78722

10/28/2022, 2:48 PM
I'm having some trouble with the DNS in my Harvester cluster. I configured the nodes with a DNS server that has some overridden domains. One of those is for my rancher cluster. The problem is that the internal cluster network for Harvester doesn't use that DNS so when I try to link it to my rancher cluster I get
dial tcp: lookup rancher.sam.intranet on 10.53.0.10:53: no such host
. Any ideas?
1
Solved it by ssh'ing into one of the management nodes and updating the Corefile of Harvester's kube deployment to forward dns for the internal domain to the upstream DNS. For anyone that finds this: 1. SSH into a management node 2.
sudo -i
- take sudo privileges 3.
kubectl -n kube-system get configmaps rke2-coredns-rke2-coredns -o yaml
- get the current coredns config 4. Grab the Corefile field and format it from the string format it's found in to a normal file format (format newlines) 5. Edit the Corefile in a text editor. To add routing to an upstream DNS server for s specific subdomain I used:
sam.intranet:53 {
  forward . 10.43.1.1:53
}
.:53 {
    errors 
    health {
        lameduck 5s
    }
    ready 
    kubernetes cluster.local cluster.local in-addr.arpa ip6.arpa {
        pods insecure
        fallthrough in-addr.arpa ip6.arpa
        ttl 30
    }
    prometheus 0.0.0.0:9153
    forward . /etc/resolv.conf
    cache 30
    loop 
    reload 
    loadbalance 
}
6.
kubectl -n kube-system edit configmaps rke2-coredns-rke2-coredns -o yaml
- edit the coredns config in vim 7. Delete the old Corefile values and replace with:
data:
  Corefile: |
    sam.intranet:53 {
      forward . 10.43.1.1:53
    }
    .:53 {
      errors 
      health {
        lameduck 5s
      }
      ready 
      kubernetes cluster.local cluster.local in-addr.arpa ip6.arpa {
        pods insecure
        fallthrough in-addr.arpa ip6.arpa
        ttl 30
      }
      prometheus 0.0.0.0:9153
      forward . /etc/resolv.conf
      cache 30
      loop 
      reload 
      loadbalance 
    }
8. Wait ~30s for the auto reload in coredns