jhunt / k8s-boshrelease

A BOSH Release for deploying Kubernetes clusters
MIT License
13 stars 9 forks source link

Support Additional CoreDNS (plugin) Configuration #62

Closed obeyler closed 4 years ago

obeyler commented 4 years ago

Feature: give the opportunity to add plugin inside configmap of coredns config Why : by example some plugin like hosts see https://coredns.io/plugins/hosts/ can be very useful to allows coredns to add hosts file to get ip from bosh topology or forward see https://coredns.io/plugins/forward/

     forward internal.paas. /etc/resolv.conf {                                                                                                                                         │
         policy sequential                                                                                                                                                             │
     }                                                                                                                                                                                 │
     hosts bosh.  /etc/hostsFromNode                                                                                                                                                   │

We can be inspired by helm template https://github.com/helm/charts/blob/6878cfd32d2240dbd907a77786d28842f6d120a0/stable/coredns/templates/configmap.yaml#L21-L25 to do that

jhunt commented 4 years ago

Would it make sense to just add an embeddable property?

i.e.:

    properties:
      coredns:
        extra-config: |
          hosts bosh. /etc/hosts/FromNode

rather than invent a new syntax via BOSH job properties?

obeyler commented 4 years ago

easiest flexible and good idea :-)

obeyler commented 4 years ago

or if you want more constrain structure as you've done for mirror of containerd a set of named attributes

properties:
  coredns:
    plugins:
      forward:
        parameters: "internal.paas. /etc/resolv.conf" 
        block:  |
          policy sequential
      hosts: 
        parameters: " bosh. /etc/hosts/FromNode"
        block: {}
jhunt commented 4 years ago

check out https://github.com/jhunt/k8s-boshrelease/pull/63, @obeyler

obeyler commented 4 years ago

we also need a way to add extra volume to be able to give the hosts file from node to the pod

      extraVolumes:
      - name: hostsfromnode
        hostPath:
          path: /etc/hosts
          type: File
      extraVolumeMounts:
      - name: hostsfromnode
        mountPath: "/etc/hostsFromNode"
jhunt commented 4 years ago

Perhaps it makes more sense to make this disableable and reconfigurable by normal kubectl means than via more and more custom BOSH parameters.

obeyler commented 4 years ago

May be.

Le 2 août 2020 à 17:28, James Hunt notifications@github.com a écrit :

Perhaps it makes more sense to make this disableable and reconfigurable by normal kubectl means than via more and more custom BOSH parameters.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jhunt/k8s-boshrelease/issues/62#issuecomment-667688162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFRF6YX7NWFA75MP4FXINCDR6WAZZANCNFSM4PNFJCWA.

obeyler commented 4 years ago

see my proposal: https://github.com/jhunt/k8s-boshrelease/pull/64