NVIDIA / gpu-operator

NVIDIA GPU Operator creates/configures/manages GPUs atop Kubernetes
Apache License 2.0
1.77k stars 286 forks source link

Allow adding custom labels to the "gpu-operator" ServiceMonitor #710

Open peihsuant opened 5 months ago

peihsuant commented 5 months ago

feature description

There is a ServiceMonitor named gpu-operator that was automatically created and is owned by the ClusterPolicy. I would like to add custom labels to it so the Prometheus instance with a serviceMonitorSelector can scrape it.

Thanks.

cdesiniotis commented 5 months ago

@peihsuant this is already possible today with the dcgmExporter.serviceMonitor.additionalLabels field in clusterpolicy.

peihsuant commented 5 months ago

Hi @cdesiniotis, what I need to modify is the servicemonitor of gpu-operator not dcgmExporter, thanks.

cdesiniotis commented 5 months ago

@peihsuant apologies, I misread the description. I see we do not have any fields for configuring the gpu-operator ServiceMonitor, unlike for dcgmExporter.

If you are interested in working on this, PRs against our gitlab repository are always welcome. https://gitlab.com/nvidia/kubernetes/gpu-operator

csauoss commented 2 months ago

@cdesiniotis I would like to give this a try if its still needed.

cdesiniotis commented 2 months ago

@csauoss yes this is open. PRs are welcome here https://github.com/NVIDIA/gpu-operator/pulls

csauoss commented 2 months ago

@cdesiniotis thank you, but should I create a MR in gitlab(since documentation mentions it) or a PR here is fine as well?

csauoss commented 2 months ago

@cdesiniotis I created MR 1099 in gitlab for this issue for now. Please review it when you get a chance.

cdesiniotis commented 2 months ago

@csauoss we have recently migrated to GitHub and now perform development here. Can you open your PR against https://github.com/NVIDIA/gpu-operator?

(since documentation mentions it)

Can you point me to where our documentation states this?

csauoss commented 2 months ago

Thanks @cdesiniotis! sounds good, will PR here in that case. Here in CONTRIBUTING.md file is where I saw references to Gitlab.

csauoss commented 2 months ago

Thanks @cdesiniotis! sounds good, will PR here in that case. Here in CONTRIBUTING.md file is where I saw references to Gitlab.

Actually the pr template in github too

cdesiniotis commented 2 months ago

Thank you for pointing this out. I have filed https://github.com/NVIDIA/gpu-operator/pull/851 to update our docs.

csauoss commented 2 months ago

@cdesiniotis I created pr #850 in github to address this issue. Please review it when you get a chance. Thanks!