This message was deleted.
# k3d
a
This message was deleted.
f
@wide-garage-9465 pinging you because I see you responding to other questions here (sorry if that's not ok). Any suggestions? Looks like this isn't actually working (it keeps getting reverted) and I may need to go back to 4.4.6.
w
Is that actually a patch that you're deploying there?
Would you get along with the coredns-custom configmap?
f
I tried the
coredns-custom
configmap, but couldn't figure out how to get it working.
And yes, I'm using an actual patch. The contents of that patch file are:
Copy code
data:
  Corefile: |
    .:53 {
        errors
        health
        ready
        rewrite name regex (.*).<http://local.example.com|local.example.com> public-nginx-ingress-nginx-controller.default.svc.cluster.local
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
        }
        hosts /etc/coredns/NodeHosts {
          ttl 60
          reload 15s
          fallthrough
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
I just copied the default and added my rewrite rule
I'm new to dealing with coredns and I've never managed dns zone files, so it's entirely possible I'm missing something simple.
w
OK. k3d is now also overwriting K3s' default CoreDNS file. It was meant as a temporary solution until coredns-custom was ready, but it wasn't removed yet. I could imagine (though I don't know how), that it interferes with your solution here. With the coredns-custom configmap you can add another zone for .example.com, which would be separate from the root zone (.:53)
f
I think I tried that, but I tried enough things that I can't remember for sure. ๐Ÿ™ƒ I'll try it again.
Hope that helps ๐Ÿ™‚
I have to get into this topic again ๐Ÿ˜ฌ
f
Copy code
apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  example.server: |
    .<http://example.com|example.com> {
      rewrite name regex (.*).<http://local.example.com|local.example.com> public-nginx-ingress-nginx-controller.default.svc.cluster.local
    }
I think this is what should work then?
w
Yup, I guess/hope so
f
ok, gonna try that ๐Ÿคž
w
Not sure if any additional configuration is needed then
f
So far no luck ๐Ÿ˜ž
Finally got it. I'm using a config file for k3d and I was setting
image
to an old version. ๐Ÿคฆ I removed that and I'm letting k3d set the image now. With that in place this works:
Copy code
apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns-custom
  namespace: kube-system
data:
  local.server: |
    <http://local.example.com|local.example.com> {
        rewrite name regex (.*).<http://local.example.com|local.example.com> public-nginx-ingress-nginx-controller.default.svc.cluster.local
        kubernetes cluster.local in-addr.arpa ip6.arpa {
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
        }
    }
Thanks for the pointers. I'd seen the github thread, but that blog post was really helpful for testing.
w
Great! Glad that you got it working :)