Skip to content

Commit

Permalink
Configure Prometheus to access DCGM metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
guptaNswati committed Mar 16, 2020
1 parent f916504 commit 2062173
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/state-monitoring/0400_prom_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus-k8s
namespace: gpu-operator-resources
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch
13 changes: 13 additions & 0 deletions assets/state-monitoring/0500_prom_rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus-k8s
namespace: gpu-operator-resources
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-k8s
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: openshift-monitoring
File renamed without changes.
15 changes: 15 additions & 0 deletions assets/state-monitoring/0700_service_monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: nvidia-dcgm-exporter
namespace: gpu-operator-resources
spec:
endpoints:
- port: gpu-metrics
jobLabel: app
namespaceSelector:
matchNames:
- gpu-operator-resources
selector:
matchLabels:
app: nvidia-dcgm-exporter
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions deployments/gpu-operator/templates/resources-namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ apiVersion: v1
kind: Namespace
metadata:
name: gpu-operator-resources
labels:
openshift.io/cluster-monitoring: "true"

0 comments on commit 2062173

Please sign in to comment.