Skip to content

Commit

Permalink
fix(metrics): add service monitor config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Peeler committed Jan 23, 2019
1 parent 85363e8 commit 581c8b5
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions deploy/chart/templates/0000_50_00-namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: {{ .Values.namespace }}
labels:
openshift.io/run-level: "1"
openshift.io/cluster-monitoring=true
---
apiVersion: v1
kind: Namespace
Expand Down
102 changes: 102 additions & 0 deletions deploy/chart/templates/0000_50_18-service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: olm-operator
namespace: {{ .Values.namespace }}
labels:
app: olm-operator
spec:
jobLabel: k8s-app
endpoints:
- port: http-metrics
interval: 30s
scheme: http
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
selector:
matchLabels:
app: olm-operator
namespaceSelector:
matchNames: {{ .Values.namespace }}
---
apiVersion: v1
kind: Service
metadata:
name: olm-operator
namespace: {{ .Values.namespace }}
labels:
app: olm-operator
spec:
ports:
- name: http-metrics
port: 8081
protocol: TCP
targetPort: http
selector:
app: olm-operator
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: catalog-operator
namespace: {{ .Values.namespace }}
labels:
app: catalog-operator
spec:
jobLabel: k8s-app
endpoints:
- port: http-metrics
interval: 30s
scheme: http
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
selector:
matchLabels:
app: catalog-operator
namespaceSelector:
matchNames: {{ .Values.namespace }}
---
apiVersion: v1
kind: Service
metadata:
name: catalog-operator
namespace: {{ .Values.namespace }}
labels:
app: catalog-operator
spec:
ports:
- name: http-metrics
port: 8081
protocol: TCP
targetPort: http
selector:
app: catalog-operator
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: operator-lifecycle-manager-metrics
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: operator-lifecycle-manager-metrics
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: {{ .Values.namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus-k8s
namespace: {{ .Values.namespace }}
rules:
- apiGroups:
- ""
resources:
- nodes
- services
- endpoints
- pods
verbs:
- get
- list
- watch

0 comments on commit 581c8b5

Please sign in to comment.