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

View File

@ -89,6 +89,13 @@ spec:
{{- end }} {{- end }}
command: command:
- /mgr-start.sh - /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: livenessProbe:
exec: exec:
command: command:

View File

@ -28,9 +28,15 @@ metadata:
{{- end }} {{- end }}
spec: spec:
ports: ports:
- port: {{ .Values.network.port.mgr }} - name: ceph-mgr
port: {{ tuple "ceph_mgr" "internal" "mgr" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
protocol: TCP 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: selector:
{{ tuple $envAll "ceph" "mgr" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ tuple $envAll "ceph" "mgr" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }} {{- end }}

View File

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