helm icon indicating copy to clipboard operation
helm copied to clipboard

rke2 cluster cannot set coredns corefile correctly.

Open zeddit opened this issue 2 years ago • 1 comments

I want to add a nameserver for some domains for my cluster, e.g. I want my coredns corefile to be like below:

.:53 {
        errors
        health
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
        }
        prometheus :9153
        forward . 172.16.0.1
        cache 30
        loop
        reload
        loadbalance
    }
    example.org:53 { #adding a block here
        errors
        cache 30
        forward . 10.150.0.1
    }

So I set my helm chart values to be like:

 servers:
    - zones:
      - zone: .
      plugins:
      port: 53
      plugins:
      - name: errors
      - name: health
        configBlock: |-
          lameduck 5s
      - name: ready
      - name: kubernetes
        parameters: cluster.local in-addr.arpa ip6.arpa
        configBlock: |-
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
          ttl 30
      - name: prometheus
        parameters: 0.0.0.0:9153
      - name: forward
        parameters: . /etc/resolv.conf
      - name: cache
        parameters: 30
      - name: loop
      - name: reload
      - name: loadbalance
    - zones:
      - zone: example.org
      plugins:
      - name: errors
      - name: forward
        parameters: . 10.150.0.1
      - name: cache
        parameters: 30

And in rke2 cluster, these settings should be put under /var/lib/rancher/rke2/server/manifests/rke2-coredns-config.yaml.

However, these configuration cannot take effect. I wonder if I am doing wrong to set multiple nameservers?

zeddit avatar Feb 17 '23 11:02 zeddit

Not sure I understand what you're trying to achieve, you installed the chart but require that the coredns config be on a specific path on the host file system?

hagaibarel avatar Mar 28 '23 10:03 hagaibarel