ExternalDNS: Cloudflare - Creates A records instead of CNAMES


I just configured a new Environment on Rancher using a clean host and i followed this steps:

  1. Installed Traefik from Catalog and set TRAEFIK_HTTP_PORT: ‘80’
  2. Installed CloudFlare DNS from Catalog and set up the NAME_TEMPLATE: '%{{stack_name}}'
    so it will create subdomains like: http://.mydomain.com
  3. Installed Ghost from Catalog and set HTTP port to 82.

This configuration gives me 2 issues:

  1. If i deploy Ghost from Catalog on port 82, Cloudflare DNS will create an A record and if i try to go to http://.mydomain.com it won’t work, it needs to be a CNAME in order to function properly as a sub-domain.

  2. With traefik implemented and filling the right labels, i should be able to not expose any port on host from my stacks, Traefik will route traffic to my stacks without having any port exposed but Cloudflare won’t detect my stacks to update DNS if there is no port exposed.

Do you have any solution to this?, this doesn’t help me to have dynamic environments.