问题
error doing DNS lookup for NS records for "kubernetes.xxxx.xxx": lookup kubernetes.xxxxxxxx.xxx on 10.0.2.3:53: read udp 10.0.2.15:56154->10.0.2.3:53: i/o timeout
only my kops update cluster throws the following all other commands looks fine
here is my kops validate cluster
Using cluster from kubectl context: kubernetes.xxxx.xxx
Validating cluster kubernetes.xxxxxx.xxxx
INSTANCE GROUPS NAME ROLE MACHINETYPE MIN MAX SUBNETS master-xxx-xxxx-1a Master t2.micro 1 1 xx-xxxxx-1a nodes Node t2.micro 2 2 xx-xxxxxx-1a
NODE STATUS NAME ROLE READY ip-xxxx-xx-xx-xxx.xxx-xxxxx-x.compute.internal master True
Validation Failed Ready Master(s) 1 out of 1. Ready Node(s) 0 out of 2.
your nodes are NOT ready kubernetes.xxxxxx.xxx
回答1:
It's a dns issue. I did a nslookup to my name servers and added the IP's to /etc/resolv.conf file
nameserver 10.0.2.3
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
search xxxxxx
search kubernetes.xxxxxx.xxx
and when i ran kops update cluster now. It fixed the issue.
回答2:
As you wrote in the comment, you are trying to call the command from your VM which is outside of the VPC network.
Looks like in your system you set the DNS server address as 10.0.2.3:53
and it is unavailable, that's why you cannot resolve your zone from the VM.
To fix it, edit your /etc/hosts
file and set the nameserver address to 8.8.8.8
, for example.
If your Kubernetes DNS zone is OK, you will be able to resolve it, of course (in case you are using a public DNS zone).
With a private DNS zone, it is pretty the same, but you should set the DNS server address of that zone instead of 8.8.8.8
.
回答3:
You need just to add an entry to your /etc/resolv.conf
nameserver 8.8.8.8
NB : I suppose that you have well configured your NS record, otherwise you can follow this doc
来源:https://stackoverflow.com/questions/49747280/unable-to-update-kops-cluster-dns-lookup-error