0

My pods can't find the URL https://nfe.sefaz.go.gov.br/nfe/services/NFeAutorizacao4.

I did a test and added the DNS 8.8.8.8 and 8.8.4.4 in the /etc/resolve.conf file of one of the pods, and the URL is found.

The file /etc/resolve.conf looks like this

search default.svc.cluster.local svc.cluster.local cluster.local
nameserver 10.245.0.10
nameserver 8.8.8.8
nameserver 8.8.4.4
options ndots:5

My question is:

Is there a correct way to correct the cluster DNS and leave it in an automated way?

We use CoreDNS, Corefile:

.:53 {
    errors
    health
    ready
    kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      fallthrough in-addr.arpa ip6.arpa
    }
    prometheus :9153
    forward . /etc/resolv.conf
    cache 30
    loop
    reload
    loadbalance
    import custom/*.override
}
import custom/*.server
Masoud Keshavarz
  • 2,166
  • 9
  • 36
  • 48
Guilherme
  • 31
  • 3
  • Are you able to find ANY DNS names? Your 10.x.x.x address is a local address inside your network. Is there a reason they would be filtering your requests? Why not just delete that line? – Tim Roberts May 28 '22 at 00:07
  • The address 10.245.0.10, is the IP of the CoreDNS Service in the cluster.This information is entered into the pod's 'resolve.conf' file automatically upon pod creation. I can find the mentioned address only after adding the Google DNS(8.8.8.8.8/8.8.4.4) in the resolve.conf file. – Guilherme May 28 '22 at 13:02
  • @Guilherme Is your issue solved ? If yes, can you provide the resolution steps you have followed and provide it as an answer for the greater visibility of the community. – Sai Chandra Gadde Aug 09 '22 at 07:38

1 Answers1

0

I solved that by creating the ConfigMap 'coredns-custom', which is the coredns default

It looks like this:

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  custom.server: |
    specific-domain:53 {
      log
      forward . 8.8.8.8 8.8.4.4
    }

replace 'specific-domain' with some specific domain or '*'.

Guilherme
  • 31
  • 3