I am stuck on some name resolve error and couldn’t fix this for a few days. I hope someone here is familiar with this error.
I got this error while I installing gitpod on a running k3s 2 nodes cluster. Some pods are crashing and then I checked logs and it shows the blow error.
root@gitpod0:/home/ubuntu# kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
...
kube-system coredns-b96499967-vjj5s 1/1 Running 22 (36m ago) 40d
gitpod kotsadm-7cb65ff498-c7j8x 0/1 Init:CrashLoopBackOff 581 (4m50s ago) 2d19h
gitpod kotsadm-559f89585b-qg5gv 0/1 Init:CrashLoopBackOff 7 (4m41s ago) 16m
cattle-system cattle-cluster-agent-6ff754d5b5-ftdws 0/1 CrashLoopBackOff 463 (2m42s ago) 3d
cattle-system cattle-cluster-agent-5648c7f94d-9wvdc 0/1 CrashLoopBackOff 461 (2m44s ago) 2d23h
logs for cattle-cluster-agent
2022-10-09T23:59:25.263300722Z stdout F failed to connect to postgres: failed to connect to postgres: failed to connect to `host=kotsadm-postgres user=kotsadm database=kotsadm`: hostname resolving error (lookup kotsadm-postgres on 10.43.0.10:53: dial udp 10.43.0.10:53: i/o timeout)
root@gitpod0:/home/ubuntu# kubectl exec -i -t dnsutils -- nslookup kotsadm-postgres
Server: 10.43.0.10
Address: 10.43.0.10#53
** server can't find kotsadm-postgres: NXDOMAIN
Meanwhile I put kotsadm-postgres in /etc/hosts
but it didn’t solve the issue. I tried to add a coredns-custom yaml file and forward kotsadm-postgres to the loopback address but no. Really hope someone can point me the correct direction as I feel no way to resolve this myself.