Home > OS >  Configure kubernetes to DNS resolve the given domain as the first try, instead of using given-domain
Configure kubernetes to DNS resolve the given domain as the first try, instead of using given-domain

Time:04-10

By default, when we raise a request from a Pod to another pod, Kubernetes is trying to append .namespace.svc.cluster.local to the domain we gave and try to resolve.

But in our case, we are already using a fully qualified URL to raise the request (enter image description here As you can see, for every single successful request, there are 4 failed request before it.

CodePudding user response:

Lowering the ndots will fix the issue

ndots: sets a threshold for the number of dots which must appear in a name before an initial absolute query will be made. The default for n is 1, meaning that if there are any dots in a name, the name will be tried first as an absolute name before any search list elements are appended to it.

Try this :

spec:
  containers:
    - name: ...
      image: ...
  dnsConfig:
    options:
      - name: ndots
        value: "1"
  • Related