Kubernetes and External-DNS

4/5/2020

I am running a K8S cluster in GCP with cert-manager and external-dns with a ingress-nginx-ingress-controller ( Loadbalancer = external IP "abc" )

Each frontend-service request a letsenrypt certificate via a DNS ( Zone is setup in GCP ) e1.exapmle.com

second frontend-service on e2.example.com

Both DNS entries are pointing to the external IP "ABC". So far so good

Right now I am adding a new DNS entries for the subdomain manually ( i.e. e3.example.com) and thought ( hope ) to use external-DNS to do the automatics creation of the DNS entry in my zone. External-DNS creates a new DNS entry but not with the IP of my external load balancer IP "abc". It is a new IP address.

Is there a way to setup external-DNS that it manages the DNS entries ( creates a new ) and "maps" it to my external Loadbalancer IP instead of a new one ?

-- Peter Mueller
dns
external-dns
kubernetes

1 Answer

4/22/2020

Its hard to reply without any additional information, but I feel you have to configure publishService and set it to true in the ingress.

## Allows customization of the external service
  ## the ingress will be bound to via DNS
  publishService:
    enabled: true

There were similar question and issues on github related this behavior:

Static nginx-ingress IP is not used

external-dns assigns node IP instead of nginx-ingress IP

If you are using helm charts: this is a place to change publishService: https://github.com/helm/charts/blob/master/stable/nginx-ingress/values.yaml#L90-L92

You may also want to read Enabling publish-service for ClusterIP nginx-ingress controller service

-- VKR
Source: StackOverflow