feat: make ServiceMonitor API group configurable
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
apiGrouptoServiceMonitorConfigwithGetAPIGroup()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) forazmonitoring.coreos.com/servicemonitors - Document the AKS setting in
values.yaml
Testing
go test ./controllers/... -run TestServiceMonitor
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.
@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.