Hello everyone. I am trying to add a rke2 cluster ...
# harvester
s
Hello everyone. I am trying to add a rke2 cluster inside my harvester cluster. The deployment fails at the point where the harvester-cloud-provider tries to reach the rancher instance to register. The reason is, is that I have a split dns setup and my internal hostnames are not exposed outside. The harvester-cloud-provider container has the google dns servers hardcoded within /etc/resolv.conf. Core-dns waits for the cloud-provider to fully come up, which it can't. I would appreciate any pointers on how would I go about injecting my internal DNS servers into the harvester-cloud-provider container?
h
Great question - why don’t you have a DNS server that forwards to Google but answers your local records? It’s going to get the dn server from the hosts
s
I am not sure I understand. My internal servers are setup and ultimately forward requests they can't resolve. The internal servers are never queried by the container, so this setup is "useless" in this case.
So within the container, I get the error: E0927 131545.596965 1 node_controller.go:229] error syncing 'c2rke2-harv-pool1-rpskp-7jx6z': failed to get instance metadata for node c2rke2-harv-pool1-rpskp-7jx6z: Get "https://rancher.mydomain.net/k8s/clusters/c-7mt2j/apis/kubevirt.io/v1/namespaces/default/virtualmachines/c2rke2-harv-pool1-rpskp-7jx6z": dial tcp: lookup rancher.mydomain.net on 8.8.8.853 no such host, requeuing
and rancher.mydomain.net is only resolvable via the internal DNS servers
so the google dns servers get injected somewhere else along the line. the container running within podman gets the nodes entries injected into resolv.conf
I was able to inject the correct hostname via the kubelet-arg config option by setting a custom resolv.conf. I am still wondering, why it was not set in the first place.
Found it: rke2[1577]: time="2025-09-29T052946Z" level=warning msg="Host resolv.conf includes loopback, multicast, or link-local nameservers - kubelet will use autogenerated resolv.conf with nameservers 8.8.8.8 200148604860::8888"
b
BTW: You could also "inject" the rancher name via cloud-init into the VMs /etc/hosts. That's a really dirty method, but if all else is failing...