SUSE Support

Here When You Need Us

How to customize rke2-coredns

This document (000021179) is provided subject to the disclaimer at the end of this document.

Environment

A Rancher-provisioned or standalone RKE2 cluster

Situation

RKE2 allows the use of HelmChartConfig resources to customize add-on packages deployed as Helm Charts. This can be used to customize RKE2 packaged compoments, such as Canal, CoreDNS and ingress-nginx.

Resolution

Details on the customization of components via HelmChartConfig resources can be found within the RKE2 documentation

In the example below, we will use a HelmChartConfig to add a custom zonefile to rke2-coredns for the domain example.com
 

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: rke2-coredns
  namespace: kube-system
spec:
  valuesContent: |-
    zoneFiles:
      - filename: example.com.conf
        domain: example.com
        contents: |
          example.com:53 {
              errors
              cache 30
              forward . 10.0.254.1
          }
    extraConfig:
      import:
        parameters: /etc/coredns/example.com.conf

 

Rancher-provisioned RKE2 cluster

To apply this HelmChartConfig customization in a Rancher-provisioned RKE2 cluster, navigate to the Cluster Management view and click Edit Config for the desired cluster. Click the Add-On Config tab and add the HelmChartConfig manifest into the Additional Manifest section, before clicking Save.
 

Standalone RKE2 cluster

Create the file /var/lib/rancher/rke2/server/manifests/rke2-coredns-config.yaml, containing the HelmChartConfig manifest, on a server node within the RKE2 cluster. After that, the rke2-server service on the node should be restarted to apply the change.
 

Verify the customization

In this case, with a customization to the rke2-coredns configuration, the configmap rke2-coredns-rke2-coredns can be reviewed to determine if the change was successful:

kubectl -n kube-system get configmap rke2-coredns-rke2-coredns -o json

 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021179
  • Creation Date: 21-Aug-2023
  • Modified Date:07-Aug-2024
    • SUSE Rancher

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.