Skip to content

Commit

Permalink
feat: Add optional annotations & endpointAdditionalProperties to Serv…
Browse files Browse the repository at this point in the history
…iceMonitor in helm chart (#1452)

Signed-off-by: Adrian Berger <adrian.berger@bedag.ch>
  • Loading branch information
adberger authored Aug 23, 2023
1 parent 3d8c89d commit 4862faf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.15.1
version: 0.16.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 3 additions & 1 deletion deploy/helm/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# trivy-operator

![Version: 0.15.1](https://img.shields.io/badge/Version-0.15.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.1](https://img.shields.io/badge/AppVersion-0.15.1-informational?style=flat-square)
![Version: 0.16.0](https://img.shields.io/badge/Version-0.16.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.1](https://img.shields.io/badge/AppVersion-0.15.1-informational?style=flat-square)

Keeps security report resources updated

Expand Down Expand Up @@ -83,7 +83,9 @@ Keeps security report resources updated
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created. |
| serviceAccount.name | string | `""` | name specifies the name of the k8s Service Account. If not set and create is true, a name is generated using the fullname template. |
| serviceMonitor.annotations | object | `{}` | Additional annotations for the serviceMonitor |
| serviceMonitor.enabled | bool | `false` | enabled determines whether a serviceMonitor should be deployed |
| serviceMonitor.endpointAdditionalProperties | object | `{}` | EndpointAdditionalProperties allows setting additional properties on the endpoint such as relabelings, metricRelabelings etc. |
| serviceMonitor.honorLabels | bool | `true` | HonorLabels chooses the metric’s labels on collisions with target labels |
| serviceMonitor.interval | string | `nil` | Interval at which metrics should be scraped. If not specified Prometheus’ global scrape interval is used. |
| serviceMonitor.labels | object | `{}` | Additional labels for the serviceMonitor |
Expand Down
9 changes: 9 additions & 0 deletions deploy/helm/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ServiceMonitor
metadata:
name: {{ include "trivy-operator.fullname" . }}
namespace: {{ .Values.serviceMonitor.namespace | default (include "trivy-operator.namespace" . ) }}
{{- if .Values.serviceMonitor.annotations }}
annotations:
{{- toYaml .Values.serviceMonitor.annotations | nindent 4 }}
{{- end }}
labels:
{{- include "trivy-operator.labels" . | nindent 4 }}
{{- if .Values.serviceMonitor.labels }}
Expand All @@ -24,4 +28,9 @@ spec:
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
scheme: http
{{- if .Values.serviceMonitor.endpointAdditionalProperties }}
{{- with .Values.serviceMonitor.endpointAdditionalProperties }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,14 @@ serviceMonitor:
namespace: ~
# -- Interval at which metrics should be scraped. If not specified Prometheus’ global scrape interval is used.
interval: ~
# -- Additional annotations for the serviceMonitor
annotations: {}
# -- Additional labels for the serviceMonitor
labels: {}
# -- HonorLabels chooses the metric’s labels on collisions with target labels
honorLabels: true
# -- EndpointAdditionalProperties allows setting additional properties on the endpoint such as relabelings, metricRelabelings etc.
endpointAdditionalProperties: {}

trivyOperator:
# -- vulnerabilityReportsPlugin the name of the plugin that generates vulnerability reports `Trivy`
Expand Down

0 comments on commit 4862faf

Please sign in to comment.