<p>which service assigns nameservers under  /etc/resolv.conf of pods , generally it should pickup from host /etc/resolv.conf , i'm seeing different nameservers under /etc/resolv.conf of pods, is there is any configuration on kbernetes(kubedns) which i can configure so that  pods   /etc/resolv.conf have 8.8.8.8</p>

venkatesh pakanati
<p>I had the same issue over Jenkins deployed on Kubernetes. If you don't mention a nameserver then <em>/etc/resolv.conf</em> shows the default nameserver (ip of k8s).
I solved this by modifying the deploy file with</p>
<pre><code>      dnsPolicy: &quot;None&quot;
      dnsConfig:
        nameservers:
          - 8.8.8.8
</code></pre>
<p>and applying it.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins
  namespace: jenkins
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jenkins
  template:
    metadata:
      labels:
        app: jenkins
    spec:
      containers:
      - name: jenkins
        image: jenkins/jenkins:lts
        ports:
          - name: http-port
            containerPort: 8080
          - name: jnlp-port
            containerPort: 50000
        volumeMounts:
          - name: jenkins-vol
            mountPath: /var/jenkins_vol
      dnsPolicy: &quot;None&quot;
      dnsConfig:
        nameservers:
          - 8.8.8.8    
      volumes:
        - name: jenkins-vol
          emptyDir: {}
</code></pre>
