diff --git a/elasticsearch/templates/monitoring/prometheus/bin/_elasticsearch-exporter.sh.tpl b/elasticsearch/templates/monitoring/prometheus/bin/_elasticsearch-exporter.sh.tpl deleted file mode 100644 index 60b7136be..000000000 --- a/elasticsearch/templates/monitoring/prometheus/bin/_elasticsearch-exporter.sh.tpl +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -{{/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/}} - -COMMAND="${@:-start}" - -function start () { - exec /bin/elasticsearch_exporter \ - -es.uri=$ELASTICSEARCH_URI \ - -es.all={{ .Values.conf.prometheus_elasticsearch_exporter.es.all | quote }} \ - -es.timeout={{ .Values.conf.prometheus_elasticsearch_exporter.es.timeout }} \ - -web.telemetry-path={{ .Values.endpoints.prometheus_elasticsearch_exporter.path.default }} -} - -function stop () { - kill -TERM 1 -} - -$COMMAND diff --git a/elasticsearch/templates/monitoring/prometheus/exporter-configmap-bin.yaml b/elasticsearch/templates/monitoring/prometheus/exporter-configmap-bin.yaml deleted file mode 100644 index 69b018cee..000000000 --- a/elasticsearch/templates/monitoring/prometheus/exporter-configmap-bin.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{{/* -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/}} - -{{- if and .Values.manifests.monitoring.prometheus.configmap_bin_exporter .Values.monitoring.prometheus.enabled }} -{{- $envAll := . }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: elasticsearch-exporter-bin -data: - elasticsearch-exporter.sh: | -{{ tuple "bin/_elasticsearch-exporter.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} -{{- end }} diff --git a/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml b/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml index 23057b08b..ba5673933 100644 --- a/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/elasticsearch/templates/monitoring/prometheus/exporter-deployment.yaml @@ -53,14 +53,38 @@ spec: {{ tuple $envAll $envAll.Values.pod.resources.exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ dict "envAll" $envAll "application" "exporter" "container" "elasticsearch_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} command: - - /tmp/elasticsearch-exporter.sh - - start - lifecycle: - preStop: - exec: - command: - - /tmp/elasticsearch-exporter.sh - - stop + - "elasticsearch_exporter" + - '--es.uri=$(ELASTICSEARCH_URI)' + - '--web.telemetry-path={{ .Values.endpoints.prometheus_elasticsearch_exporter.path.default }}' + - '--web.listen-address=:{{ .Values.endpoints.prometheus_elasticsearch_exporter.port.metrics.default }}' + - '--es.timeout={{ .Values.conf.prometheus_elasticsearch_exporter.es.timeout }}' + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.all }} + - '--es.all' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.indices }} + - '--es.indices' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.indices_settings }} + - '--es.indices_settings' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.shards }} + - '--es.shards' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.snapshots }} + - '--es.snapshots' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.ssl_skip_verify }} + - '--es.ssl-skip-verify' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.ca }} + - '--es.ca={{ .Values.conf.prometheus_elasticsearch_exporter.es.ca }}' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.client_private_key }} + - '--es.client-private-key={{ .Values.conf.prometheus_elasticsearch_exporter.es.client_private_key }}' + {{- end }} + {{- if .Values.conf.prometheus_elasticsearch_exporter.es.client_cert }} + - '--es.client-cert={{ .Values.conf.prometheus_elasticsearch_exporter.es.client_cert }}' + {{- end }} env: - name: ELASTICSEARCH_URI valueFrom: @@ -78,15 +102,7 @@ spec: volumeMounts: - name: pod-tmp mountPath: /tmp - - name: elasticsearch-exporter-bin - mountPath: /tmp/elasticsearch-exporter.sh - subPath: elasticsearch-exporter.sh - readOnly: true volumes: - name: pod-tmp emptyDir: {} - - name: elasticsearch-exporter-bin - configMap: - name: elasticsearch-exporter-bin - defaultMode: 0555 {{- end }} diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index 35f7add9f..fac62829a 100644 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -24,7 +24,7 @@ images: s3_bucket: docker.io/openstackhelm/ceph-daemon:ubuntu_bionic-20191216 s3_user: docker.io/openstackhelm/ceph-config-helper:ubuntu_bionic-20191216 helm_tests: docker.io/openstackhelm/heat:newton-ubuntu_xenial - prometheus_elasticsearch_exporter: docker.io/justwatch/elasticsearch_exporter:1.0.1 + prometheus_elasticsearch_exporter: docker.io/justwatch/elasticsearch_exporter:1.1.0 dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0 snapshot_repository: docker.io/openstackhelm/ceph-config-helper:ubuntu_bionic-20191216 es_cluster_wait: docker.io/openstackhelm/ceph-config-helper:ubuntu_bionic-20191216 @@ -736,8 +736,16 @@ conf: master: "-Xms256m -Xmx256m" prometheus_elasticsearch_exporter: es: - all: true timeout: 20s + all: true + indices: true + indices_settings: true + shards: true + snapshots: true + ssl_skip_verify: true + ca: null + client_private_key: null + client_cert: null templates: fluent: index_patterns: "logstash-*"