knot: auto restart on configmap change implemented

This commit is contained in:
Nico Schottelius 2021-07-18 10:49:33 +02:00
parent fa632aac17
commit 7b06056aed
3 changed files with 41 additions and 53 deletions

View File

@ -2,23 +2,4 @@ apiVersion: v2
name: knotdns
description: DNS Auth
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "any"

View File

@ -13,13 +13,20 @@ spec:
labels:
app: {{ .Release.Name }}-knot
use-as-service: {{ .Release.Name }}
annotations:
checksum/config: {{ include (print $.Template.BasePath
"/knotconf.yaml") . | sha256sum }}
spec:
initContainers:
containers:
- name: knot
image: cznic/knot:3.0
ports:
- containerPort: 53
- name: udp-53
containerPort: 53
protocol: UDP
- name: tcp-53
containerPort: 53
protocol: TCP
volumeMounts:
- name: config
mountPath: "/config"
@ -60,35 +67,3 @@ metadata:
name: {{ tpl .Values.identifier . }}-zones
data:
{{ tpl (.Files.Glob "zones/*").AsConfig . | indent 2 }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ tpl .Values.identifier . }}-config
data:
knot.conf: |
server:
listen: 0.0.0.0@53
listen: ::@53
log:
- target: stdout
zone:
- domain: place7.ungleich.ch
file: /zones/place7.ungleich.ch
notknot.conf: |
server:
listen: 0.0.0.0@53
listen: ::@53
log:
- target: stdout
zone:
{{- range $path, $_ := .Files.Glob "zones/*" }}
{{- $domain := base $path }}
{{ printf "- domain: %s" $domain | indent 2}}
{{ printf "file: /zones/%s" $domain | indent 4}}
{{ end }}

View File

@ -0,0 +1,32 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ tpl .Values.identifier . }}-config
data:
knot.conf: |
server:
listen: 0.0.0.0@53
listen: ::@53
log:
- target: stdout
zone:
- domain: place7.ungleich.ch
file: /zones/place7.ungleich.ch
notknot.conf: |
server:
listen: 0.0.0.0@53
listen: ::@53
log:
- target: stdout
zone:
{{- range $path, $_ := .Files.Glob "zones/*" }}
{{- $domain := base $path }}
{{ printf "- domain: %s" $domain | indent 2}}
{{ printf "file: /zones/%s" $domain | indent 4}}
{{ end }}