-
Notifications
You must be signed in to change notification settings - Fork 431
add ServiceMonitor Configuration #1486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
c3d9469
491a4b1
efc42d7
62cb67d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| {{- if .Values.scheduler.servicemonitor.enabled }} | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| {{- if .Values.devicePlugin.monitor.servicemonitor.annotations }} | ||
| annotations: | ||
| {{ toYaml .Values.devicePlugin.monitor.servicemonitor.annotations | nindent 4 }} | ||
| {{- end }} | ||
| name: {{ include "hami-vgpu.device-plugin" . }} | ||
| namespace: {{ include "hami-vgpu.namespace" . }} | ||
| labels: | ||
| {{- include "hami-vgpu.labels" . | nindent 4 }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Considering add default label |
||
| {{- if .Values.devicePlugin.monitor.servicemonitor.labels }} | ||
| {{ toYaml .Values.devicePlugin.monitor.servicemonitor.labels | indent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| endpoints: | ||
| - path: /metrics | ||
| port: monitorport | ||
| scheme: http | ||
| interval: {{ .Values.devicePlugin.monitor.servicemonitor.interval | default "15s" }} | ||
| honorLabels: {{ .Values.devicePlugin.monitor.servicemonitor.honorLabels | default false }} | ||
| namespaceSelector: | ||
| matchNames: | ||
| - {{ include "hami-vgpu.namespace" . }} | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/component: hami-device-plugin | ||
| {{- include "hami-vgpu.labels" . | nindent 6 }} | ||
| {{- if .Values.devicePlugin.service.labels }} # Use devicePlugin instead of scheduler | ||
|
||
| {{ toYaml .Values.devicePlugin.service.labels | indent 6 }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| {{- if .Values.scheduler.servicemonitor.enabled }} | ||
| apiVersion: monitoring.coreos.com/v1 | ||
| kind: ServiceMonitor | ||
| metadata: | ||
| {{- if .Values.scheduler.servicemonitor.annotations }} | ||
| annotations: | ||
| {{ toYaml .Values.scheduler.servicemonitor.annotations | nindent 4 }} | ||
| {{- end }} | ||
| name: {{ include "hami-vgpu.scheduler" . }} | ||
| namespace: {{ include "hami-vgpu.namespace" . }} | ||
| labels: | ||
| {{- include "hami-vgpu.labels" . | nindent 4 }} | ||
| {{- if .Values.scheduler.servicemonitor.labels }} | ||
| {{ toYaml .Values.scheduler.servicemonitor.labels | indent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| endpoints: | ||
| - path: /metrics | ||
| port: monitor | ||
| scheme: http | ||
| interval: {{ .Values.scheduler.servicemonitor.interval | default "15s" }} | ||
| honorLabels: {{ .Values.scheduler.servicemonitor.honorLabels | default false }} | ||
| namespaceSelector: | ||
| matchNames: | ||
| - {{ include "hami-vgpu.namespace" . }} | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/component: hami-scheduler | ||
| {{- include "hami-vgpu.labels" . | nindent 6 }} | ||
| {{- if .Values.scheduler.service.labels }} | ||
| {{ toYaml .Values.scheduler.service.labels | indent 6 }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a copy-paste error in this conditional check. The creation of the device-plugin
ServiceMonitorshould be controlled by its own configuration flag,.Values.devicePlugin.monitor.servicemonitor.enabled, not the scheduler's flag. As it is, thisServiceMonitorwould be incorrectly created only when the scheduler's monitor is enabled.{{- if .Values.devicePlugin.monitor.servicemonitor.enabled }}