How To Customize CoreDNS Configuration for Adding Additional External DNS

Problem

How To Customize CoreDNS Configuration for Adding Additional External DNS.

Environment

  • Platform9 Managed Kubernetes - v5.2 and K8s v1.20 and Higher
  • AddOn Management

Procedure

  1. Generate the TOKEN by following steps mentioned in Keystone Identity.
  2. API to retrieve existing CoreDNS ClusterAddon object detail.
API GET Call
Copy
Example Showing Default Set Parameters
Copy
Example Existing Associated ConfigMap
Copy
  1. Create a new JSON spec file with the required additional DNS configuration parameter.

The extra DNS configuration parameter one wants to add should have no indentations. The addon operator adds the correct indentation before adding it under the DNS block in the configmap.

Sample DNS configuration without indentation
Copy
base64 Encoding of the sample configuration
Copy

This needs to be inputted as a value for the parameter base64EncAdditionalDnsConfig in the JSON spec file.

Sample JSON File
Copy

You can read more about it here CoreDNS Addon.

  1. Patch the existing CoreDNS ClusterAddon object with the newly created Spec file coredns.json.
Command
Copy

Replace the placeholders <DU_FQDN>, <PROJECT_ID> and the <CLUSTER_UUID> with their appropriate values required. The name attribute in the spec must be in the format CLUSTER_UUID-coredns

The CoreDNS version in the above JSON file is currently on 1.7.0. It will be updated along with the pf9-kube version and can be referred from the Support Matrix.

Updated ConfigMap after the PATCH API Call
Copy

The changes made to the AddOn object will persist across management plane & cluster upgrades.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard