Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pod unable to install packages(apt-get update or apt-get install )

I have observed that the pods in my cluster is not able to install the packages when exec to the pod . While debugging i have realized that its due to /etc/resolv.conf entries.

The /etc/resolv.conf entry from one of the pod is :

nameserver 192.168.27.116
search ui-container.svc.cluster.local svc.cluster.local cluster.local 192.168.27.116.nip.io
options ndots:5

Here if i remove a entry 192.168.27.116.nip.io from the resolv.conf of all the master, worker nodes then the pods will be able to connect to internet and apt-get update and apt-get install works. This is only a temporary workaround because it is not recommended to update the resolv.conf. because i have observed that resolv.conf contents gets re-set to original upon reboot of the nodes.

Is it due to options ndots:5 in the /etc/resolv.conf ?

How can i fix this?

like image 710
Rakesh Kotian Avatar asked Sep 03 '20 08:09

Rakesh Kotian


1 Answers

As a quick-fix, you could leverage dnsConfig from pod Spec to override default dns configuration, more details: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config

like image 128
Ottovsky Avatar answered Sep 22 '22 14:09

Ottovsky