Skip to content

Commit

Permalink
[stable/traefik] add servicemonitor (helm#13728)
Browse files Browse the repository at this point in the history
* feat: imporvements to pachyderm chart (helm#13054)

* feat: imporvements to pachyderm chart

- De-hardcode suite label to allow deployment in a different namespace
than `pachyderm`
- De-hardcode service account name to allow deployment in a different
namespace than `pachyderm`
- Allow specifying resource limits for `etcd` and `patchd` deployments
- Split `pachd` service in 3 stand alone services to allow exposing
`pachd-grpc-api` through a LoadBalancer service type
- `pachd-grpc-api` port can be customized
- `pachd` deployment now support iam-role annotation for `kube2iam`

Signed-off-by: Maxime Belanger <[email protected]>

* add variables to support 1.8.x

Signed-off-by: Maxime Belanger <[email protected]>

* node port fixed to 30650

Signed-off-by: Maxime Belanger <[email protected]>

* boolean as stringwq

Signed-off-by: Maxime Belanger <[email protected]>

* fix typo

Signed-off-by: Maxime Belanger <[email protected]>

* quote the value in the template instead

Signed-off-by: Maxime Belanger <[email protected]>
Signed-off-by: Philipp Hellmich <[email protected]>

* some changes based on feedback of dtomcej

Signed-off-by: Philipp Hellmich <[email protected]>

* commented out servicemonitor as requested in PR

Signed-off-by: Philipp Hellmich <[email protected]>

* fix

Signed-off-by: Philipp Hellmich <[email protected]>
  • Loading branch information
runningman84 authored and Thomas Tischner committed Aug 13, 2019
1 parent 61d9973 commit 63e32c9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/traefik/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: traefik
version: 1.75.1
version: 1.76.0
appVersion: 1.7.12
description: A Traefik based Kubernetes ingress controller with Let's Encrypt support
keywords:
Expand Down
1 change: 1 addition & 0 deletions stable/traefik/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ The following table lists the configurable parameters of the Traefik chart and t
| `metrics.prometheus.enabled` | Whether to enable the `/metrics` endpoint for metric collection by Prometheus. | `false` |
| `metrics.prometheus.restrictAccess` | Whether to limit access to the metrics port (8080) to the dashboard service. When `false`, it is accessible on the main Traefik service as well. | `false` |
| `metrics.prometheus.buckets` | A list of response times (in seconds) - for each list element, Traefik will report all response times less than the element. | `[0.1,0.3,1.2,5]` |
| `metrics.serviceMonitor.enabled` | Whether to enable servicemonitor for Prometheus. | `false` |
| `metrics.datadog.enabled` | Whether to enable pushing metrics to Datadog. | `false` |
| `metrics.datadog.address` | Datadog host in the format <hostname>:<port> | `localhost:8125` |
| `metrics.datadog.pushInterval` | How often to push metrics to Datadog. | `10s` |
Expand Down
30 changes: 30 additions & 0 deletions stable/traefik/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if ( .Values.metrics.serviceMonitor ) }}
{{- if and ( .Values.metrics.serviceMonitor.enabled ) ( .Values.metrics.prometheus.enabled ) }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.metrics.serviceMonitor.labels }}
labels:
{{ toYaml .Values.metrics.serviceMonitor.labels | indent 4}}
{{- end }}
name: {{ template "traefik.fullname" . }}-prometheus-exporter
{{- if .Values.metrics.serviceMonitor.namespace }}
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
{{- end }}
spec:
endpoints:
- targetPort: metrics
path: /metrics
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
{{- end }}
jobLabel: {{ template "traefik.fullname" . }}-prometheus-exporter
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: {{ template "traefik.name" . }}
release: {{ .Release.Name | quote }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions stable/traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,15 @@ metrics:
## it to the dashboard service only
restrictAccess: false
# buckets: [0.1,0.3,1.2,5]
# serviceMonitor:
# When set true and if Prometheus Operator is installed then use a ServiceMonitor to configure scraping
# enabled: false
# Set the namespace the ServiceMonitor should be deployed
# namespace: monitoring
# Set how frequently Prometheus should scrape
# interval: 30s
# Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator
# labels:
datadog:
enabled: false
# address: localhost:8125
Expand Down

0 comments on commit 63e32c9

Please sign in to comment.