External-dns: Ingress hosts are not getting DNS names created.

Created on 12 Jul 2018  路  16Comments  路  Source: kubernetes-sigs/external-dns

https://github.com/kubernetes-incubator/external-dns/blob/master/docs/tutorials/nginx-ingress.md

I followed the tutorial and I am not getting any DNS records created for ingress objects. It DOES work correctly when I annotate services with _external-dns.alpha.kubernetes.io/hostname: hellofromkubernetes.k8s.me.me_

_time="2018-07-11T22:40:50Z" level=info msg="No matching hosted zones"_ is the only message reported.

I am using registry.opensource.zalan.do/teapot/external-dns:latest with the following arguments.

62 args:
63 - --source=service
64 - --source=ingress
65 - --domain-filter=k8s.me.me # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
66 - --provider=aws
67 - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
68 - --aws-zone-type=public # only look at public hosted zones (valid values are public, private or no value for both)
69 - --registry=txt
70 - --txt-owner-id=my-identifier

Additionally. The A record for my service is being created with the private IPs of all of my nodes. How can I have the value of the A record be the public IP attached to a service, or ingress controller?

hellofromkubernetes2.k8s.me.me. | A | 10.0.0.212 10.0.0.211 10.0.0.134 10.0.0.133 10.0.0.132 10.0.0.111 10.0.0.213 10.0.0.222 10.0.0.221 10.0.0.214 10.0.0.215 10.0.0.216 10.0.0.217 10.0.0.218 10.0.0.219 10.0.0.220 | 聽

Most helpful comment

@cabrinoob - If you are using the nginx-ingress helm chart, look at

      publishService:
        enabled: true

within the values.yaml

All 16 comments

Exactly the same problem here. I'am using an EKS Cluster on AWS and it works fine on public and private hosted zones with service annotation.

But using Ingress I see nothing created in my public or privated hosted zone.

@cabrinoob @bpinske Please run kubectl get ingress <your-ingress> and check whether the ADDRESS column is correctly populated.

@bpinske what's the Type of your Service object?

Hi,
I experienced the same and then I added --publish-service=$INGRESS_CONTROLLER_NAMESPACE/$INGRESS_CONTROLLER_CONTAINER_NAME
and it started working.

See https://github.com/kubernetes/ingress-nginx/blob/c0ed143fbd0909dcf2d75d74c84e6bbbca4b80fb/docs/user-guide/cli-arguments.md

Hope it helps,
Ohad

@linki : ADDRESS is correctly populated with the ELB of my nginx-ingress controller

@odavid : $INGRESS_CONTROLLER_CONTAINER_NAME is the name of the service or the pod of your ingress controller?

the service
sorry

@cabrinoob - If you are using the nginx-ingress helm chart, look at

      publishService:
        enabled: true

within the values.yaml

@odavid : Now it works!

@odavid @cabrinoob Great! 馃帀 For anyone stumbling here as well this is also documented at

https://github.com/kubernetes-incubator/external-dns/blob/v0.5.4/docs/tutorials/nginx-ingress.md#with-a-separate-tcp-load-balancer

@linki : Ok, I did not see this doc because it is related to GCE and I'am under AWS. But thank you!

For the Traefik ingress, you'll need to:

  1. Add the publishedService config option
[kubernetes.ingressEndpoint]
publishedService = "kube-system/traefik-ingress-service"
  1. Add a section to the RBAC for updating ingress status
- apiGroups:
    - extensions
  resources:
    - ingresses/status
  verbs:
    - update

@cptaffe Any chance you could share the YAML for your Traefik setup. I can't for the life of me get this working for Ingresses. It works fine for Services.

This is my current setup for just testing with the Traefik example Cheese sites: https://gist.github.com/rosstimson/5d2d4eb1ef676a6744d8b3bfeab882cc

You can see I have added the Traefik config you mentioned: https://gist.github.com/rosstimson/5d2d4eb1ef676a6744d8b3bfeab882cc#file-traefik-yml-L68-L71

Also the RBAC additions: https://gist.github.com/rosstimson/5d2d4eb1ef676a6744d8b3bfeab882cc#file-traefik-yml-L28-L33

Back in the external-dns logs I just get:

time="2018-09-13T16:24:39Z" level=debug msg="No endpoints could be generated from ingress dev/cheese"

So it definitely is looking at the Ingresses but just not creating the Route 53 record. If I manually add a record pointing to the ELB of the Traefik service the cheese sites work fine so all that side of things is wired up properly.

I'd love to see how you have set this up to compare with my config if you don't mind sharing.

Make sure the host in the ingress is one you control in Route53

@cptaffe Oh, it definitely is one I control, I just replaced with example.com in the gist. Like I say, this is working fine for services (type: LoadBalancer) that have the annotation, just not Ingresses.

Oh! Your Traefik config should be

publishedService = "kube-system/traefik-ingress-service"

since you've named your service traefik-ingress-service.

I've updated my original comment so it matches with the tutorial :)

Exactly command to get it work with Helm:

helm install --namespace kube-system --name nginx-ingress \
  --set controller.publishService.enabled=true            \
  stable/nginx-ingress
Was this page helpful?
0 / 5 - 0 ratings