gpu-operator icon indicating copy to clipboard operation
gpu-operator copied to clipboard

feat: make ServiceMonitor API group configurable

Open amarkdotdev opened this issue 5 months ago • 2 comments

Summary

Fixes #2397.

Azure Managed Prometheus on AKS registers ServiceMonitor under azmonitoring.coreos.com instead of monitoring.coreos.com. This change adds an optional apiGroup field to ServiceMonitorConfig (defaulting to monitoring.coreos.com) and uses it when looking up the ServiceMonitor CRD and creating/updating ServiceMonitor objects.

Changes

  • Add apiGroup to ServiceMonitorConfig with GetAPIGroup() helper and documented defaults
  • Resolve the ServiceMonitor CRD name and GVK from the configured API group at reconcile time
  • Extend operator RBAC (Helm chart and config/rbac/role.yaml) for azmonitoring.coreos.com/servicemonitors
  • Document the AKS setting in values.yaml

Testing

  • go test ./controllers/... -run TestServiceMonitor

amarkdotdev avatar Jun 23 '26 19:06 amarkdotdev

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

copy-pr-bot[bot] avatar Jun 23 '26 19:06 copy-pr-bot[bot]

@mohityadav8 @tariq1890 @cdesiniotis Gentle ping on this one for #2397.

Adds optional apiGroup to ServiceMonitorConfig (defaults to monitoring.coreos.com) so AKS Azure Managed Prometheus users can use azmonitoring.coreos.com. Small, scoped Helm + controller change with RBAC updates.

I see fork PRs need NVIDIA runner vetting before full CI runs — happy to adjust anything needed for that. Would appreciate a review when you have time.

amarkdotdev avatar Jul 02 '26 12:07 amarkdotdev