Browse Source

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>
pull/4463/head
Thorsten Klein 3 years ago committed by Brad Davidson
parent
commit
41ff19de71
  1. 8
      manifests/coredns.yaml
  2. 1
      pkg/apis/k3s.cattle.io/v1/zz_generated_deepcopy.go
  3. 3
      pkg/deploy/zz_generated_bindata.go
  4. 5
      pkg/static/zz_generated_bindata.go

8
manifests/coredns.yaml

@ -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

1
pkg/apis/k3s.cattle.io/v1/zz_generated_deepcopy.go

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

3
pkg/deploy/zz_generated_bindata.go

File diff suppressed because one or more lines are too long

5
pkg/static/zz_generated_bindata.go

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save