k8gb-io / coredns-crd-plugin

CoreDNS plugin to use DNSEndpoint custom resource.
Apache License 2.0
21 stars 7 forks source link

Make plugin more extensible #37

Open kuritka opened 2 years ago

kuritka commented 2 years ago

k8s_crd plugin works well but will be extended which requires extra changes.

As plugin growths and more functionality is required, the k8s_crd plugin must execute multiple independent parts (another plugins / subplugins).

Currently the plugin has one larger function ServeDNS making core logic, but extending new - independent functionality leads to mixing with the old functionality.

Consider how to refactor k8s_crd to be able to run independent modules and keep them maintainable, testable. (e.g: by extending middleware (multiple ServeDNS funcs)? / run all in one ServeDNS but as submodules ? ….).

nit: look at configuration :

  {{ .Values.k8gb.dnsZone }}:5353 {
        errors
        health
        ready
        prometheus 0.0.0.0:9153
        forward . /etc/resolv.conf
        k8s_crd {
            loadbalance weight
            resources DNSEndpoint
            filter k8gb.absa.oss/dnstype=local
            negttl {{ .Values.k8gb.dnsZoneNegTTL }}
        }
    }

^^^ consider if changes are necessary as well.

ytsarev commented 3 months ago

@kuritka is this one still valid?