ungleich-k8s/apps/knotdns/templates/deployment.yaml

95 lines
1.9 KiB
YAML
Raw Normal View History

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-knot
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-knot
2021-07-17 23:42:12 +00:00
replicas: 2
template:
metadata:
labels:
app: {{ .Release.Name }}-knot
use-as-service: {{ .Release.Name }}
spec:
initContainers:
containers:
- name: knot
image: cznic/knot:3.0
ports:
- containerPort: 53
volumeMounts:
- name: config
mountPath: "/config"
- name: zones
mountPath: "/zones"
args:
- knotd
volumes:
- name: config
configMap:
name: {{ tpl .Values.identifier . }}-config
- name: zones
configMap:
name: {{ tpl .Values.identifier . }}-zones
---
apiVersion: v1
kind: Service
metadata:
name: {{ tpl .Values.identifier . }}
labels:
app: {{ tpl .Values.identifier . }}
spec:
type: ClusterIP
ports:
- port: 53
protocol: TCP
name: tcp-53
- port: 53
protocol: UDP
name: udp-53
selector:
use-as-service: {{ .Release.Name }}
---
apiVersion: v1
kind: ConfigMap
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
2021-07-17 23:42:12 +00:00
notknot.conf: |
server:
listen: 0.0.0.0@53
listen: ::@53
log:
- target: stdout
zone:
2021-07-18 08:38:34 +00:00
{{- range $path, $_ := .Files.Glob "zones/*" }}
2021-07-17 23:42:12 +00:00
{{- $domain := base $path }}
{{ printf "- domain: %s" $domain | indent 2}}
{{ printf "file: /zones/%s" $domain | indent 4}}
{{ end }}