Skip to content

Commit

Permalink
Helm: Add OSS prometheus exporter support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean-Coakley committed Aug 27, 2018
1 parent 7005576 commit 5b9b8c8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
10 changes: 7 additions & 3 deletions helm-chart/templates/controller-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
labels:
app: {{ .Values.controller.name | trunc 63 }}
{{- if .Values.prometheus }}
{{- if and (.Values.controller.nginxplus) (.Values.prometheus.create) }}
{{- if .Values.prometheus.create }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.prometheus.port }}"
Expand Down Expand Up @@ -93,7 +93,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.prometheus }}
{{- if and (.Values.controller.nginxplus) (.Values.prometheus.create) }}
{{- if .Values.prometheus.create }}
- image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}"
imagePullPolicy: "{{ .Values.prometheus.image.pullPolicy }}"
name: nginx-prometheus-exporter
Expand All @@ -103,9 +103,13 @@ spec:
args:
- -web.listen-address
- :{{ .Values.prometheus.port }}
- -nginx.plus
- -nginx.scrape-uri
{{- if .Values.controller.nginxplus }}
- -nginx.plus
- http://127.0.0.1:8080/api
{{ else }}
- http://127.0.0.1:8080/stub_status
{{- end }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 7 additions & 3 deletions helm-chart/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
labels:
app: {{ .Values.controller.name | trunc 63 }}
{{- if .Values.prometheus }}
{{- if and (.Values.controller.nginxplus) (.Values.prometheus.create) }}
{{- if .Values.prometheus.create }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "{{ .Values.prometheus.port }}"
Expand Down Expand Up @@ -79,7 +79,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.prometheus }}
{{- if and (.Values.controller.nginxplus) (.Values.prometheus.create) }}
{{- if .Values.prometheus.create }}
- image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}"
name: nginx-prometheus-exporter
imagePullPolicy: "{{ .Values.prometheus.image.pullPolicy }}"
Expand All @@ -89,9 +89,13 @@ spec:
args:
- -web.listen-address
- :{{ .Values.prometheus.port }}
{{- if .Values.controller.nginxplus }}
- -nginx.plus
- -nginx.scrape-uri
- http://127.0.0.1:8080/api
{{ else }}
- http://127.0.0.1:8080/stub_status
{{- end }}
- -nginx.scrape-uri
{{- end }}
{{- end }}
{{- end }}
7 changes: 7 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ controller:
enableLeaderElection: true
rbac:
create: true
prometheus:
create: false
port: 9113
image:
repository: nginx/nginx-prometheus-exporter
tag: "0.1.0"
pullPolicy: IfNotPresent

0 comments on commit 5b9b8c8

Please sign in to comment.