Skip to content

Commit

Permalink
[stable/chartmuseum] Add serviceMonitor to chartmuseum chart (helm#21455
Browse files Browse the repository at this point in the history
)

* Add serviceMonitor to chartmuseum chart

Signed-off-by: Philippe Dagenais <pgdagenais@gmail.com>

* Remove unneeded ) -- fix linting

Signed-off-by: Philippe Dagenais <pgdagenais@gmail.com>
  • Loading branch information
pgdagenais authored Mar 13, 2020
1 parent 1e5928c commit a6c7ef7
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/chartmuseum/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Host your own Helm Chart Repository
name: chartmuseum
version: 2.8.0
version: 2.9.0
appVersion: 0.11.0
home: https://github.com/helm/chartmuseum
icon: https://raw.githubusercontent.com/helm/chartmuseum/master/logo2.png
Expand Down
6 changes: 6 additions & 0 deletions stable/chartmuseum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ their default values. See values.yaml for all available options.
| `service.loadBalancerSourceRanges` | Restricts access for LoadBalancer (only for Service type LoadBalancer) | `[]` |
| `service.servicename` | Custom name for service | `` |
| `service.labels` | Additional labels for service | `{}` |
| `serviceMonitor.enabled` | Enable the ServiceMontor resource to be deployed | `false` |
| `serviceMonitor.labels` | Labels for the servicemonitor used by the Prometheus Operator | `{}` |
| `serviceMonitor.namespace` | Namespace of the ServiceMonitor resource | `{{ .Release.Namespace }}` |
| `serviceMonitor.metricsPath` | Path to the Chartmuseum metrics path | `/metrics` |
| `serviceMonitor.interval` | Scrape interval, If not set, the Prometheus default scrape interval is used | `nil` |
| `serviceMonitor.timeout` | Scrape request timeout. If not set, the Prometheus default timeout is used | `nil` |
| `deployment.labels` | Additional labels for deployment | `{}` |
| `deployment.matchlabes` | Match labels for deployment selector | `{}` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
Expand Down
34 changes: 34 additions & 0 deletions stable/chartmuseum/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.serviceMonitor.enabled ) }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.serviceMonitor.labels }}
labels:
{{ toYaml .Values.serviceMonitor.labels | indent 4 }}
{{- end }}
name: {{ template "chartmuseum.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
spec:
endpoints:
- targetPort: 8080
{{- if .Values.serviceMonitor.interval }}
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
{{- if .Values.serviceMonitor.metricsPath }}
path: {{ .Values.serviceMonitor.metricsPath }}
{{- end }}
{{- if .Values.serviceMonitor.timeout }}
scrapeTimeout: {{ .Values.serviceMonitor.timeout }}
{{- end }}
jobLabel: {{ template "chartmuseum.fullname" . }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: {{ template "chartmuseum.name" . }}
release: {{ .Release.Name }}
{{- end }}
8 changes: 8 additions & 0 deletions stable/chartmuseum/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ service:
annotations: {}
labels: {}

serviceMonitor:
enabled: false
# namespace: prometheus
labels: {}
metricsPath: "/metrics"
# timeout: 60
# interval: 60

resources: {}
# limits:
# cpu: 100m
Expand Down

0 comments on commit a6c7ef7

Please sign in to comment.