External Dns registers private ip with cloudflare instead of public ip

1k Views Asked by At

After deploying External-Dns to our K8 cluster using official Helm bitnami/external-dns chart dns records are created in cloudflare but the ip address regitered are private and not public ip. Due to this my certificate generation with cert-manager also fails.

Helm chart: https://github.com/bitnami/charts/tree/master/bitnami/external-dns Values.yaml for helm chart


## Modify how DNS records are synchronized between sources and providers (options: sync, upsert-only)
##
policy: sync

logLevel: debug

domainFilters:
- example.xyz

## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources:
  limits:
    cpu: 50m
    memory: 50Mi
  requests:
    memory: 50Mi
    cpu: 10m

## If specified, the pod's tolerations.
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
##
tolerations:
- key: "infra"
  operator: "Equal"
  value: "true"
  effect: "NoSchedule"

## Cloudflare configuration to be set via arguments/env. variables
##
cloudflare:
  ## `CF_API_TOKEN` to set in the environment
  ##
  apiToken: "NOJNFOJNOSJNOMSPKPLMPMP"
  ## `CF_API_EMAIL` to set in the environment
  ##
  email: "[email protected]"
  ## Enable the proxy feature of Cloudflare
  ##
  proxied: false

Once this is deployed, I can see in the logs that the records are getting created but private ip and not public ip. logs

time="2022-01-20T09:55:31Z" level=debug msg="Endpoints generated from ingress: devops-gitops/argo: [argo.example.xyz 0 IN A  10.1.0.2;10.1.0.3;10.1.0.4;10.244.0.1 [] argo.example.xyz 0 IN A  10.1.0.2;10.1.0.3;10.1.0.4;10.244.0.1 []]"
time="2022-01-20T09:55:31Z" level=debug msg="Endpoints generated from ingress: devops-gitops/test: [test.example.xyz 0 IN A  10.1.0.2;10.1.0.3;10.1.0.4;10.244.0.1 [] example.xyz 0 IN A  10.1.0.2;10.1.0.3;10.1.0.4;10.244.0.1 []]"
time="2022-01-20T09:55:31Z" level=debug msg="Endpoints generated from ingress: ingress-nginx/test1: [test1.example.xyz 0 IN A  10.1.0.2;10.1.0.3;10.1.0.4;10.244.0.1 [] example.xyz 0 IN A  10.1.0.2;10.1.0.3;10.1.0.4;10.244.0.1 []]"

The ingress are created from Rancher->Cluster->Service-Discovery->Ingress. And external-dns is deployed in a new namespace created for extenral-dns and cert-manager

Kubernetes cluster is deployed in Rancher

1

There are 1 best solutions below

0
Blender Fox On

External DNS will use whatever IP is generated on the service. If you have mapped an internal IP on the service, External DNS will use that on its DNS updates.