diff --git a/memcached/templates/bin/_memcached-exporter.sh.tpl b/memcached/templates/bin/_memcached-exporter.sh.tpl index d10e6b723..08b4d919e 100644 --- a/memcached/templates/bin/_memcached-exporter.sh.tpl +++ b/memcached/templates/bin/_memcached-exporter.sh.tpl @@ -18,7 +18,7 @@ set -ex COMMAND="${@:-start}" function start () { - exec /bin/memcached_exporter + exec /bin/memcached_exporter --memcached.address "$MEMCACHED_HOST:$MEMCACHED_PORT" } function stop () { diff --git a/memcached/templates/service.yaml b/memcached/templates/service.yaml index 7c5a28ff1..2776fd455 100644 --- a/memcached/templates/service.yaml +++ b/memcached/templates/service.yaml @@ -24,10 +24,6 @@ spec: ports: - name: memcache port: {{ tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} -{{- if .Values.monitoring.prometheus.enabled }} - - name: metrics - port: {{ tuple "oslo_cache" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} -{{- end }} selector: {{ tuple $envAll "memcached" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ .Values.network.memcached | include "helm-toolkit.snippets.service_params" | indent 2 }} diff --git a/memcached/templates/statefulset.yaml b/memcached/templates/statefulset.yaml index 65e172706..6d4c4f44d 100644 --- a/memcached/templates/statefulset.yaml +++ b/memcached/templates/statefulset.yaml @@ -102,6 +102,11 @@ spec: readOnly: true {{- if .Values.monitoring.prometheus.enabled }} - name: memcached-exporter + env: + - name: MEMCACHED_HOST + value: 127.0.0.1 + - name: MEMCACHED_PORT + value: {{ tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} {{ tuple $envAll "prometheus_memcached_exporter" | include "helm-toolkit.snippets.image" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.prometheus_memcached_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ dict "envAll" $envAll "application" "server" "container" "memcached_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}