cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
149 stars 45 forks source link

document coreDNS override #321

Open nabuskey opened 1 week ago

nabuskey commented 1 week ago

As mentioned in #317, we should document how to override coreDNS configurations.

Two ways to do it:

  1. Override the main corefile. e.g. the coredns CM in kube-system
  2. Override the imported configuration file. coredns-conf-custom CM in kube-system

A few points about CoreDNS I should make clear:

  1. CoreDNS file allows you to import files matching a pattern.
  2. By default, CoreDNS installation only mounts the corefile key within coredns CM.

Taken together, what we need to do to allow our default customization and possible further customization:

  1. Update the coredns CM to use the import plugin, then make it look for files matching /etc/coredns-configs/*.conf
  2. Populate /etc/coredns-configs/ with two files (sourced from CMs):
    • One that contains our default configuration. That is to resolve the name given by the host flag and all subdomains to the internal ingress address.
    • One that is empty. This is to allow for other packages to update this file for further DNS configurations. In the absence of this file, other packages must update the coredns deployment.
  3. Update the coredns deployment to mount the two CMs.