Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to modify default server and plugins without complely overwriting them #78

Closed
blowfishpro opened this issue Sep 15, 2022 · 2 comments

Comments

@blowfishpro
Copy link

The way helm values work, if a particular value (or sub-value at any level) is an array, you can't modify it, only overwrite it. This makes modifying the default server and its plugins very difficult, your only option is to basically re-create the entire servers value with what you want.

One solution that's been employed elsewhere is to use a dict rather than an array. The keys may or may not actually be used but that allows the contents to be modified, added to, or removed.

Maybe plugins could be indexed by their name? The CoreDNS docs are clear that the order of plugins does not matter, although it's not immediately clear to me whether certain plugins can be used more than once in the same server (most don't seems to support or expect this though).

It might also be possible to do this in a backwards-compatible way although I haven't really thought through all the details there.

Related to #75

An example of the default config rewritten in this format might look like this:

servers:
  default:
    zones:
    - zone: .
    port: 53
    plugins:
      errors: {}
      health:
        configBlock: |-
          lameduck 5s
      ready: {}
      kubernetes:
        parameters: cluster.local in-addr.arpa ip6.arpa
        configBlock: |-
          pods insecure
          fallthrough in-addr.arpa ip6.arpa
          ttl 30
      prometheus:
        parameters: 0.0.0.0:9153
      forward:
        parameters: . /etc/resolv.conf
      cache:
        parameters: 30
      loop: {}
      reload: {}
      loadbalance: {}
@hungran
Copy link

hungran commented Feb 17, 2023

Each zone needs to be preceded by the - zones directive rather than just being values in the collection.
same with #75
So this:

- servers
  - zones:
    - zone: aaa
    - zone: bbb

should instead be expressed as

- servers:
  - zones:
    - zone: aaa
  - zones:
    - zone: bbb

@hagaibarel
Copy link
Collaborator

Closing as answered, if you have further questions please raise another issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants