Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Add namespace to service monitor (#186)
Browse files Browse the repository at this point in the history
* Add namespace to service monitor
* Add namespace example to service monitor
* Update README.md
  • Loading branch information
ElfoLiNk authored Nov 10, 2021
1 parent 8ac6927 commit 6b6e757
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
apiVersion: v2
name: nifi
version: 1.0.0
version: 1.0.1
appVersion: 1.14.0
description: Apache NiFi is a software project from the Apache Software Foundation designed to automate the flow of data between software systems.
keywords:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ The following table lists the configurable parameters of the nifi chart and the
| `metrics.prometheus.enabled` | Enable prometheus to access nifi metrics endpoint | `false` |
| `metrics.prometheus.port` | Port where Nifi server will expose Prometheus metrics | `9092` |
| `metrics.prometheus.serviceMonitor.enabled` | If `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.prometheus.enabled` to be `true`) | `false` |
| `metrics.prometheus.serviceMonitor.namespace` | In which namespace the ServiceMonitor should be created |
| `metrics.prometheus.serviceMonitor.labels` | Additional labels for the ServiceMonitor | `nil` |

## Troubleshooting
Expand Down
5 changes: 4 additions & 1 deletion templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "apache-nifi.fullname" . }}
{{- with .Values.metrics.prometheus.serviceMonitor.namespace }}
namespace: {{ . }}
{{- end }}
labels:
app: {{ include "apache-nifi.name" . | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
Expand Down Expand Up @@ -34,4 +37,4 @@ spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace | quote }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -367,5 +367,6 @@ metrics:
serviceMonitor:
# Enable deployment of Prometheus Operator ServiceMonitor resource
enabled: false
# namespace: monitoring
# Additional labels for the ServiceMonitor
labels: {}

0 comments on commit 6b6e757

Please sign in to comment.