How to customize rke2-coredns
This document (000021179) is provided subject to the disclaimer at the end of this document.
Situation
Resolution
The name and namespace should match the ones used when deploying the package using HelmChart. The valuesContent section contains the values that you want to customize, and they will be processed like when being passed to helm directly.
For our case, we will add a new zone to coreDNS using the zoneFiles directive. You can download the coreDNS package to review the values.yml to find out the directives available for customization [2]. Or you can look at the values.yml available from the rke2-coredns charts for your version [3].
A file /var/lib/rancher/rke2/server/manifests/rke2-coredns-config.yaml should be created with similar content. After that, the rke2-server service should be restarted to apply the change.
apiVersion: helm.cattle.io/v1 kind: HelmChartConfig metadata: name: rke2-coredns namespace: kube-system spec: valuesContent: |- zoneFiles: - filename: doit.tech.conf domain: doit.tech contents: | doit.tech:53 { errors cache 30 forward . 10.0.254.1 }
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
Additional Information
[1] https://docs.rke2.io/helm
[2] https://github.com/rancher/rke2-charts/blob/main-source/packages/rke2-coredns/package.yaml
[3] https://rke2-charts.rancher.io/assets/rke2-coredns/rke2-coredns-1.24.002.tgz
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:29-Aug-2023
-
- SUSE Rancher
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com