Skip to content

Commit

Permalink
only create service with serviceMonitor
Browse files Browse the repository at this point in the history
* feat: only create service with serviceMonitor

Only create the service when `serviceMonitor.create` is set. The service
is useless otherwise. I have a project where I can only use the
`prometheusRules.enabled=true` but only want to use the prometheus
rules, not the service monitor. Also, it creates a conflict in our
deployment because we already have a similar service with that name
`vault-monitoring`.
  • Loading branch information
in0rdr authored Sep 13, 2024
1 parent b473d5e commit b9eba17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions charts/vault-monitoring/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: vault-monitoring
description: monitor your vault server from within Kubernetes' prometheus
type: application
version: 0.4.2
version: 0.5.0
home: https://github.com/adfinis/helm-charts/tree/main/charts/vault-monitoring
sources:
- https://github.com/adfinis/helm-charts/tree/main/charts/vault-monitoring
Expand All @@ -12,5 +12,5 @@ maintainers:
url: https://adfinis.com
annotations:
artifacthub.io/changes: |
- kind: fixed
description: "fix metric for vault"
- kind: changed
description: "Only create service vault-monitoring when serviceMonitor.create=true"
2 changes: 1 addition & 1 deletion charts/vault-monitoring/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions charts/vault-monitoring/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.vault.serviceMonitor.create }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -17,3 +18,4 @@ spec:
targetPort: {{ .Values.vault.port }}
sessionAffinity: None
type: {{ .Values.vault.service.type }}
{{- end }}

0 comments on commit b9eba17

Please sign in to comment.