Is there a selector for external-dns in kubernetes (eks), to route to the correct fargate instance?

527 Views Asked by At

i just set up a private EKS Cluster with an external DNS. A Service is exposed on a fargate instance and accessible via https://IP. The service is furthermore annotated with

external-dns.alpha.kubernetes.io/internal-hostname: duplicate-clearing-dev.aws.ui.loc 

Thus a DNS entry is created by the external DNS (bitnami). Yet it routes to -all- ip addresses i have running in my EKS cluster instead of the one (IP) the service is running on and i don't know why.

A similar setup with Ingress worked just find where the DNS entry routed to a Load Balancer. So my question is if i miss some kind of selector to route the DNS entry to the only one correct IP.

My service looks like this

apiVersion: v1
kind: Service
metadata:
  name: "service-duplicate-clearing"
  namespace: "duplicate-clearing"
  annotations:
    external-dns.alpha.kubernetes.io/internal-hostname: duplicate-clearing-dev.aws.ui.loc 
spec:
  ports:
    - port: 443
      targetPort: 80
      protocol: TCP
  type: NodePort
  selector:
    app: duplicate-clearing

Thanks in advance,

Eric

1

There are 1 best solutions below

0
On

What i was missing was the following input for the specs:

externalTrafficPolicy: Local