From 459d44a5ef0df729745191c4c04f2979fcbdd165 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 6 Jun 2019 09:28:11 +1000 Subject: [PATCH] [stable/helm-exporter] Add support for using ingress (#14442) * Add support for using ingress Signed-off-by: Christopher Farrenden * Use less convoluted annotation pulling Signed-off-by: Christopher Farrenden * Revert clusterIP conditional Signed-off-by: Christopher Farrenden --- stable/helm-exporter/Chart.yaml | 2 +- stable/helm-exporter/README.md | 5 ++++- stable/helm-exporter/templates/ingress.yaml | 24 +++++++++++++++++++++ stable/helm-exporter/values.yaml | 10 +++++++++ 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 stable/helm-exporter/templates/ingress.yaml diff --git a/stable/helm-exporter/Chart.yaml b/stable/helm-exporter/Chart.yaml index e6e1860f8f..746239806d 100644 --- a/stable/helm-exporter/Chart.yaml +++ b/stable/helm-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.4.0" description: Exports helm release stats to prometheus name: helm-exporter -version: 0.2.4 +version: 0.3.0 home: https://github.com/sstarcher/helm-exporter sources: - https://github.com/sstarcher/helm-exporter diff --git a/stable/helm-exporter/README.md b/stable/helm-exporter/README.md index 71bf1e5316..68148fb153 100644 --- a/stable/helm-exporter/README.md +++ b/stable/helm-exporter/README.md @@ -52,7 +52,10 @@ Parameter | Description | Default `serviceMonitor.interval` | Interval at which metrics should be scraped | `` `serviceMonitor.namespace` | The namespace where the Prometheus Operator is deployed | `` `serviceMonitor.additionalLabels` | Additional labels to add to the ServiceMonitor | `{}` - +`ingress.enabled` | Set to true if using an ingress | `false` +`ingress.annotations` | Ingress annotations | `{}` +`ingress.path` | Ingress path | `/` +`ingress.host` | Ingress hostname e.g example.com | `` ```console $ helm install stable/helm-exporter --name my-release ``` diff --git a/stable/helm-exporter/templates/ingress.yaml b/stable/helm-exporter/templates/ingress.yaml new file mode 100644 index 0000000000..2e3f3450a5 --- /dev/null +++ b/stable/helm-exporter/templates/ingress.yaml @@ -0,0 +1,24 @@ +{{- if .Values.ingress.enabled }} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ include "helm-exporter.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "helm-exporter.name" . }} + helm.sh/chart: {{ include "helm-exporter.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: + rules: + - host: {{ .Values.ingress.host }} + http: + paths: + - path: {{ .Values.ingress.path }} + backend: + serviceName: {{ include "helm-exporter.name" . }} + servicePort: 9571 +{{- end }} diff --git a/stable/helm-exporter/values.yaml b/stable/helm-exporter/values.yaml index 3a5ce4920a..71d07c33a1 100644 --- a/stable/helm-exporter/values.yaml +++ b/stable/helm-exporter/values.yaml @@ -36,3 +36,13 @@ serviceMonitor: interval: namespace: additionalLabels: {} + +ingress: + # Specifies whether an Ingress should be created + enabled: false + + annotations: {} + # kubernetes.io/ingress.class: nginx + path: / + # Name of host e.g example.com + host: