Skip to content

Commit

Permalink
[stabled/elasticsearch-exporter] add custom labels to the service and…
Browse files Browse the repository at this point in the history
… set service http port name (helm#14395)

* stable/elasticsearch-exporter: add service labels

Signed-off-by: Hector Fernandez <[email protected]>

* stable/elasticsearch-exporter: set custom name for service http port

Signed-off-by: Hector Fernandez <[email protected]>
  • Loading branch information
Hector Fernandez authored and k8s-ci-robot committed Jun 3, 2019
1 parent af2af1a commit dd0cb41
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable/elasticsearch-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Elasticsearch stats exporter for Prometheus
name: elasticsearch-exporter
version: 1.2.0
version: 1.3.0
appVersion: 1.0.2
home: https://github.com/justwatchcom/elasticsearch_exporter
sources:
Expand Down
2 changes: 2 additions & 0 deletions stable/elasticsearch-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ Parameter | Description | Default
`podAnnotations` | Pod annotations | `{}` |
`service.type` | type of service to create | `ClusterIP`
`service.httpPort` | port for the http service | `9108`
`service.metricsPort.name` | name for the http service | `http`
`service.annotations` | Annotations on the http service | `{}`
`service.labels` | Additional labels for the service definition | `{}`
`es.uri` | address of the Elasticsearch node to connect to | `localhost:9200`
`es.all` | if `true`, query stats for all nodes in the cluster, rather than just the node we connect to | `true`
`es.indices` | if true, query stats for all indices in the cluster | `true`
Expand Down
7 changes: 6 additions & 1 deletion stable/elasticsearch-exporter/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ metadata:
app: {{ template "elasticsearch-exporter.name" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- if .Values.service.labels }}
{{- range $key, $value := .Values.service.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.service.annotations }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- name: http
- name: {{ .Values.service.metricsPort.name }}
port: {{ .Values.service.httpPort }}
protocol: TCP
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
port: http
port: {{ .Values.service.metricsPort.name }}
path: {{ .Values.web.path }}
scheme: {{ .Values.serviceMonitor.scheme }}
jobLabel: "{{ .Release.Name }}"
Expand Down
3 changes: 3 additions & 0 deletions stable/elasticsearch-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ podAnnotations: {}
service:
type: ClusterIP
httpPort: 9108
metricsPort:
name: http
annotations: {}
labels: {}

es:
## Address (host and port) of the Elasticsearch node we should connect to.
Expand Down

0 comments on commit dd0cb41

Please sign in to comment.