Skip to content

Commit

Permalink
add value for override of namespace of serviceMonitor (#2258)
Browse files Browse the repository at this point in the history
* add value for override of namespace of serviceMonitor

Signed-off-by: Issif <issif+github@gadz.org>

* set version of chart to v2.0.1

Signed-off-by: Issif <issif+github@gadz.org>
  • Loading branch information
Issif committed Aug 12, 2021
1 parent 6ba341f commit 7c96bd3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kyverno/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: kyverno
version: v2.0
version: v2.0.1
appVersion: v1.4.2
icon: https://github.com/kyverno/kyverno/raw/main/img/logo.png
description: Kubernetes Native Policy Management
Expand Down
1 change: 1 addition & 0 deletions charts/kyverno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The following table lists the configurable parameters of the kyverno chart and t
| `service.port` | port for the service | `443` |
| `service.type` | type of service | `ClusterIP` |
| `serviceMonitor.enabled` | create a ServiceMonitor(Requires Prometheus) | `false` |
| `serviceMonitor.namespace` | override namespace for ServiceMonitor (default is same than kyverno) | `false` |
| `serviceMonitor.additionalLabels` | additional labels to add for ServiceMonitor | `nil` |
| `serviceMonitor.interval` | interval to scrape metrics | `30s` |
| `serviceMonitor.scrapeTimeout` | timeout if metrics can't be retrieved in given time interval | `25s` |
Expand Down
4 changes: 4 additions & 0 deletions charts/kyverno/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ metadata:
{{ toYaml .Values.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
name: {{ template "kyverno.serviceName" . }}-service-monitor
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- else }}
namespace: {{ template "kyverno.namespace" . }}
{{- end }}
spec:
selector:
matchLabels: {{ include "kyverno.matchLabels" . | nindent 6 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/kyverno/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ serviceMonitor:
# Additional labels
additionalLabels:
# key: value
# Override namespace (default is same than kyverno)
namespace:

# Interval to scrape metrics
interval: 30s
Expand Down

0 comments on commit 7c96bd3

Please sign in to comment.