Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/bind9/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: bind9
description: A flexible and production-ready Helm chart for running ISC Bind9 DNS server on Kubernetes.
type: application

version: 2026.3.1
version: 2026.3.17
appVersion: "9.21"
icon: https://www.aschnoebelen.fr/wp-content/uploads/2024/01/bind9.png

Expand Down
5 changes: 5 additions & 0 deletions charts/bind9/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ metadata:

data:
named.conf: |
{{- if .Values.metrics.enabled }}
statistics-channels {
inet 127.0.0.1 port 8053 allow { 127.0.0.1; };
};
{{- end }}
{{- .Values.bind.namedConf | nindent 4 }}

{{- range $name, $zone := .Values.bind.zones }}
Expand Down
36 changes: 32 additions & 4 deletions charts/bind9/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ spec:

command: ["/usr/sbin/named"]
args:
- "-f"
- "-g"
- "-f"
- "-g"
{{- with .Values.bind.args }}
{{- toYaml . | nindent 10 }}
{{- toYaml . | nindent 12 }}
{{- end }}

ports:
Expand Down Expand Up @@ -96,7 +96,35 @@ spec:
- name: bind-data
mountPath: /var/lib/bind
{{- end }}

{{- if .Values.metrics.enabled }}
- name: {{ .Chart.Name }}-exporter
{{- with .Values.metrics.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.metrics.image.repository }}:{{ .Values.metrics.image.tag }}"
imagePullPolicy: {{ .Values.metrics.image.pullPolicy }}
args:
- --bind.stats-url=http://127.0.0.1:8053/
- --bind.stats-groups={{ .Values.metrics.statsGroups | join "," }}
- --web.listen-address=:{{ .Values.service.ports.metrics }}
ports:
- name: metrics
containerPort: {{ .Values.service.ports.metrics }}
protocol: TCP
{{- with .Values.metrics.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.metrics.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.metrics.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumes:
- name: bind-config
configMap:
Expand Down
10 changes: 10 additions & 0 deletions charts/bind9/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ spec:
nodePort: {{ .Values.service.ports.rndcNodePort }}
{{- end }}

{{- if .Values.metrics.enabled }}
- name: metrics
port: {{ .Values.service.ports.metrics }}
targetPort: metrics
protocol: TCP
{{- if and .Values.service.ports.rndcNodePort (ne .Values.service.type "ClusterIP") }}
nodePort: {{ .Values.service.ports.rndcNodePort }}
{{- end }}
{{- end }}

selector:
{{- include "bind9.selectorLabels" . | nindent 4 }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/bind9/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "bind9.fullname" . }}
labels:
{{- include "bind9.labels" . | nindent 4 }}
spec:
endpoints:
{{ .Values.metrics.serviceMonitor.endpoints | toYaml | nindent 4 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "bind9.selectorLabels" . | nindent 6 }}
{{- end }}
48 changes: 48 additions & 0 deletions charts/bind9/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ service:
dnsTcpNodePort: 30053
dnsUdpNodePort: 30053
rndcNodePort: 30054
metrics: 9119

resources: {}
# limits:
Expand Down Expand Up @@ -95,6 +96,53 @@ autoscaling:
maxReplicas: 100
targetCPUUtilizationPercentage: 80

metrics:
enabled: false

# list of statistics to collect
statsGroups:
- server
- tasks
- view

image:
repository: prometheuscommunity/bind-exporter
pullPolicy: IfNotPresent
tag: v0.8.0

securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: metrics
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: metrics
scheme: HTTP
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1

resources: {}

serviceMonitor:
# Toggle the ServiceMonitor true if you have Prometheus Operator installed and configured
enabled: true
endpoints:
- port: metrics
scheme: http

# General Bind9 configuration
bind:
# Extra args to pass to named
Expand Down
Loading