Browse Source

knot: auto restart on configmap change implemented

master
Nico Schottelius 1 year ago
parent
commit
7b06056aed
  1. 19
      apps/knotdns/Chart.yaml
  2. 43
      apps/knotdns/templates/deployment.yaml
  3. 32
      apps/knotdns/templates/knotconf.yaml

19
apps/knotdns/Chart.yaml

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

43
apps/knotdns/templates/deployment.yaml

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

32
apps/knotdns/templates/knotconf.yaml

@ -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 }}
Loading…
Cancel
Save