Feature: Add CoreDNS Customization Options

Problem:
Before, to customize CoreDNS, one had to edit the default configmap,
which gets re-written on every K3s server restart.

Solution:
Mount an additional coredns-custom configmap into the CoreDNS container
and import overrides and additional server blocks from the included
files.

Signed-off-by: Thorsten Klein <iwilltry42@gmail.com>
This commit is contained in:
Thorsten Klein 2021-11-04 13:18:40 +01:00 committed by Brad Davidson
parent 4b57951fb0
commit 41ff19de71
4 changed files with 14 additions and 3 deletions

View File

@ -73,6 +73,7 @@ data:
reload
loadbalance
}
import /etc/coredns/custom/*.server
---
apiVersion: apps/v1
kind: Deployment
@ -131,6 +132,9 @@ spec:
- name: config-volume
mountPath: /etc/coredns
readOnly: true
- name: custom-config-volume
mountPath: /etc/coredns/custom
readOnly: true
ports:
- containerPort: 53
name: dns
@ -179,6 +183,10 @@ spec:
path: Corefile
- key: NodeHosts
path: NodeHosts
- name: custom-config-volume
configMap:
name: coredns-custom
optional: true
---
apiVersion: v1
kind: Service

View File

@ -1,3 +1,4 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long