Ceph: Add metrics port to ceph-mgr service

This adds a port for ceph metrics to the ceph-mgr service to
expose an endpoint to query directly for ceph specific metrics.
This port only gets exposed when the prometheus plugin is included
in the ceph_mgr_enabled_modules: list in ceph's values

Change-Id: I5f3a5c101a87ba5b20a644fecbe808c771b9527a
This commit is contained in:
Steve Wilkerson 2018-04-23 13:02:56 -05:00
parent 5ad77593ee
commit 2f23ed19f9
3 changed files with 17 additions and 2 deletions

@ -89,6 +89,13 @@ spec:
{{- end }}
command:
- /mgr-start.sh
ports:
- name: mgr
containerPort: {{ tuple "ceph_mgr" "internal" "mgr" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- if (has "prometheus" .Values.ceph_mgr_enabled_modules) }}
- name: metrics
containerPort: {{ tuple "ceph_mgr" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ end -}}
livenessProbe:
exec:
command:

@ -28,9 +28,15 @@ metadata:
{{- end }}
spec:
ports:
- port: {{ .Values.network.port.mgr }}
- name: ceph-mgr
port: {{ tuple "ceph_mgr" "internal" "mgr" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
protocol: TCP
targetPort: {{ .Values.network.port.mgr }}
targetPort: {{ tuple "ceph_mgr" "internal" "mgr" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ if (has "prometheus" .Values.ceph_mgr_enabled_modules) }}
- name: metrics
protocol: TCP
port: {{ tuple "ceph_mgr" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ end }}
selector:
{{ tuple $envAll "ceph" "mgr" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }}

@ -605,6 +605,8 @@ endpoints:
port:
mgr:
default: 7000
metrics:
default: 9283
scheme:
default: http