From 0b061ab20bcb93340bca179399aa1ce69dc8663c Mon Sep 17 00:00:00 2001 From: Pierre GINDRAUD Date: Tue, 17 Mar 2026 01:12:51 +0100 Subject: [PATCH 1/4] feat(bind9): Indent args as anothers parameters --- charts/bind9/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/bind9/templates/deployment.yaml b/charts/bind9/templates/deployment.yaml index c764076..a2c65b1 100644 --- a/charts/bind9/templates/deployment.yaml +++ b/charts/bind9/templates/deployment.yaml @@ -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: From 4e329b669d555df7c74db5c4c6dba5a5414e7904 Mon Sep 17 00:00:00 2001 From: Pierre GINDRAUD Date: Tue, 17 Mar 2026 01:13:15 +0100 Subject: [PATCH 2/4] feat(bind9): Add metrics container --- charts/bind9/templates/configmap.yaml | 5 +++ charts/bind9/templates/deployment.yaml | 30 ++++++++++++- charts/bind9/templates/service.yaml | 10 +++++ charts/bind9/templates/servicemonitor.yaml | 17 ++++++++ charts/bind9/values.yaml | 49 ++++++++++++++++++++++ 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 charts/bind9/templates/servicemonitor.yaml diff --git a/charts/bind9/templates/configmap.yaml b/charts/bind9/templates/configmap.yaml index 2e7c368..4e7f8f3 100644 --- a/charts/bind9/templates/configmap.yaml +++ b/charts/bind9/templates/configmap.yaml @@ -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 }} diff --git a/charts/bind9/templates/deployment.yaml b/charts/bind9/templates/deployment.yaml index a2c65b1..0024a1a 100644 --- a/charts/bind9/templates/deployment.yaml +++ b/charts/bind9/templates/deployment.yaml @@ -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: diff --git a/charts/bind9/templates/service.yaml b/charts/bind9/templates/service.yaml index 741cca7..c94bf34 100644 --- a/charts/bind9/templates/service.yaml +++ b/charts/bind9/templates/service.yaml @@ -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 }} \ No newline at end of file diff --git a/charts/bind9/templates/servicemonitor.yaml b/charts/bind9/templates/servicemonitor.yaml new file mode 100644 index 0000000..23db1cc --- /dev/null +++ b/charts/bind9/templates/servicemonitor.yaml @@ -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 }} diff --git a/charts/bind9/values.yaml b/charts/bind9/values.yaml index 36667c3..6c72f3f 100644 --- a/charts/bind9/values.yaml +++ b/charts/bind9/values.yaml @@ -60,6 +60,7 @@ service: dnsTcpNodePort: 30053 dnsUdpNodePort: 30053 rndcNodePort: 30054 + metrics: 9119 resources: {} # limits: @@ -95,6 +96,54 @@ autoscaling: maxReplicas: 100 targetCPUUtilizationPercentage: 80 +metrics: + enabled: false + + statsGroups: + - server + - tasks + - view + + image: + repository: prometheuscommunity/bind-exporter + # This sets the pull policy for images. + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + 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 From 2e621f2ff9ef217dfa6047b770bd4832f2bbb156 Mon Sep 17 00:00:00 2001 From: Pierre GINDRAUD Date: Tue, 17 Mar 2026 01:13:25 +0100 Subject: [PATCH 3/4] feat(bind9): Update version --- charts/bind9/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/bind9/Chart.yaml b/charts/bind9/Chart.yaml index a86938c..f41d591 100644 --- a/charts/bind9/Chart.yaml +++ b/charts/bind9/Chart.yaml @@ -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 From 2904fd3c4ece3d94d6298e0208a967435ee3d862 Mon Sep 17 00:00:00 2001 From: Pierre GINDRAUD Date: Tue, 17 Mar 2026 01:15:43 +0100 Subject: [PATCH 4/4] style(bind9): Typo --- charts/bind9/values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/charts/bind9/values.yaml b/charts/bind9/values.yaml index 6c72f3f..b5bc9b7 100644 --- a/charts/bind9/values.yaml +++ b/charts/bind9/values.yaml @@ -99,6 +99,7 @@ autoscaling: metrics: enabled: false + # list of statistics to collect statsGroups: - server - tasks @@ -106,9 +107,7 @@ metrics: image: repository: prometheuscommunity/bind-exporter - # This sets the pull policy for images. pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. tag: v0.8.0 securityContext: