loft-sh / loft

Namespace & Virtual Cluster Manager for Kubernetes - Lightweight Virtual Clusters, Self-Service Provisioning for Engineers and 70% Cost Savings with Sleep Mode
https://loft.sh/docs/introduction
Other
738 stars 65 forks source link

CoreDNS plugin URL target doesn't work #261

Closed mausch closed 11 months ago

mausch commented 1 year ago

Hi, I'm having a problem with the vcluster coredns plugin, seems to be a bug. As documented in https://www.vcluster.com/pro/docs/features/cross_vcluster_coredns_plugin I set:

coredns:
  integrated: true
  plugin:
    enabled: true
    config:
      - record:
          fqdn: local.elevatedirect.com
        target:
          mode: url
          url: internal-a376dc2dab55245bfa1ad24723010752-1100030150.eu-west-1.elb.amazonaws.com

From any pod in the vcluster I can run this with no problems: curl internal-a376dc2dab55245bfa1ad24723010752-1100030150.eu-west-1.elb.amazonaws.com But if run this I get "could not resolve host": curl local.elevatedirect.com I checked with dig and the problem seems to be that the DNS response for local.elevatedirect.com is missing the A entries:

$ dig local.elevatedirect.com

...
;; ANSWER SECTION:
local.elevatedirect.com. 3600   IN      CNAME   internal-a376dc2dab55245bfa1ad24723010752-1100030150.eu-west-1.elb.amazonaws.com.

;; Query time: 0 msec
;; SERVER: 10.100.22.187#53(10.100.22.187) (UDP)

For any other CNAME entry defined elsewhere the A entries are correctly returned:

$ dig app.elevatedirect.com

...
;; ANSWER SECTION:
app.elevatedirect.com.  30      IN      CNAME   d3uid99lvse5a4.cloudfront.net.
d3uid99lvse5a4.cloudfront.net. 30 IN    A       18.66.171.92
d3uid99lvse5a4.cloudfront.net. 30 IN    A       18.66.171.47
d3uid99lvse5a4.cloudfront.net. 30 IN    A       18.66.171.75
d3uid99lvse5a4.cloudfront.net. 30 IN    A       18.66.171.39

;; Query time: 32 msec
;; SERVER: 10.100.22.187#53(10.100.22.187) (UDP)
mausch commented 11 months ago

Fixed in vcluster 0.18.0-beta.0 / vcluster.pro 0.18