Skip to content

Commit

Permalink
[prometheus-cloudwatch-exporter] Added ingress configuration (helm#12407
Browse files Browse the repository at this point in the history
)

Signed-off-by: Maxime VISONNEAU <[email protected]>
  • Loading branch information
mvisonneau authored and k8s-ci-robot committed Apr 2, 2019
1 parent e460f2b commit 8be59eb
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/prometheus-cloudwatch-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.5.0"
description: A Helm chart for prometheus cloudwatch-exporter
name: prometheus-cloudwatch-exporter
version: 0.4.3
version: 0.4.4
home: https://github.com/prometheus/cloudwatch_exporter
sources:
- https://github.com/prometheus/cloudwatch_exporter
Expand Down
5 changes: 5 additions & 0 deletions stable/prometheus-cloudwatch-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ The following table lists the configurable parameters of the Cloudwatch Exporter
| `servicemonitor.interval` | How frequently Prometheus should scrape | |
| `servicemonitor.telemetryPath` | path to cloudwatch-exporter telemtery-path | |
| `servicemonitor.labels` | labels for the ServiceMonitor passed to Prometheus Operator | `{}` |
| `ingress.enabled` | Enables Ingress | `false` |
| `ingress.annotations` | Ingress annotations | `{}` |
| `ingress.labels` | Custom labels | `{}` |
| `ingress.hosts` | Ingress accepted hostnames | `[]` |
| `ingress.tls` | Ingress TLS configuration | `[]` |

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

Expand Down
42 changes: 42 additions & 0 deletions stable/prometheus-cloudwatch-exporter/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "prometheus-cloudwatch-exporter.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app: {{ template "prometheus-cloudwatch-exporter.name" . }}
chart: {{ template "prometheus-cloudwatch-exporter.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.ingress.labels }}
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions stable/prometheus-cloudwatch-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,17 @@ serviceMonitor:
# telemetryPath: /metrics
# Set labels for the ServiceMonitor, use this to define your scrape label for Prometheus Operator
# labels:

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

0 comments on commit 8be59eb

Please sign in to comment.