Skip to content

Commit

Permalink
Merge pull request #4 from wonderg/master
Browse files Browse the repository at this point in the history
Add PodMonitor Support with Metric Relabeling
  • Loading branch information
MonolithProjects authored Dec 9, 2023
2 parents e2bd1af + 89c94e0 commit 57bc03f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/node-local-dns/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: node-local-dns
version: 1.5.0
version: 1.6.0
appVersion: 1.22.24
home: https://github.com/lablabs/k8s-nodelocaldns-helm
description: NodeLocal DNS Cache helm chart
Expand Down
2 changes: 2 additions & 0 deletions charts/node-local-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Latest available `node-local-dns` image can be found at [node-local-dns google c
| imagePullSecrets | list | `[]` | |
| metrics.port | int | `9253` | |
| metrics.prometheusScrape | string | `"true"` | |
| podmonitor.enabled | bool | `false` | Enable or disable the creation of a PodMonitor resource |
| podmonitor.metricRelabelings | array | `[]` | Define metric relabeling configurations for Prometheus |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext | object | `{}` | |
Expand Down
25 changes: 25 additions & 0 deletions charts/node-local-dns/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.podmonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "node-local-dns.fullname" . }}
labels:
{{- include "node-local-dns.labels" . | nindent 4 }}
{{- if .Values.podmonitor.promOperatorSelector }}
{{ toYaml .Values.podmonitor.promOperatorSelector | nindent 4 }}
{{- end }}
{{- with .Values.podmonitor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "node-local-dns.selectorLabels" . | nindent 8 }}
podMetricsEndpoints:
- port: metrics
{{- if .Values.podmonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.podmonitor.metricRelabelings | nindent 6 }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/node-local-dns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@ resources:
metrics:
prometheusScrape: "true"
port: 9253

podmonitor:
enabled: false
metricRelabelings: []

0 comments on commit 57bc03f

Please sign in to comment.