-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Monitoring for ironic-prometheus-exporter
This commit adds the changes to enable monitoring in the machine-api-operator that will allow Prometheus to collect data from the ironic-prometheus-exporter[1] that runs in the ironic-image [2]. - Added monitoring label to namespace yaml - Added monitoring information to the rbac yaml - Added Service for the ironic-prometheus-exporter - Added the ServiceMonitor for the ironic-prometheus-exporter - Added PrometheusRule with alert for baremetal_temp_celsius metric. [1] https://github.com/metal3-io/ironic-prometheus-exporter [2] https://github.com/metal3-io/ironic-image
- Loading branch information
1 parent
8b8563a
commit c2aa4fc
Showing
5 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ metadata: | |
labels: | ||
name: openshift-machine-api | ||
openshift.io/run-level: "1" | ||
openshift.io/cluster-monitoring: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
install/0000_30_machine-api-operator_13_ironic-exporter-service.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: Service | ||
metadata: | ||
name: metal3-baremetalhost-controller | ||
namespace: openshift-machine-api | ||
labels: | ||
app: ironic-exporter | ||
spec: | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 9608 | ||
targetPort: 9608 | ||
selector: | ||
app: ironic-exporter | ||
clusterIP: None | ||
type: ClusterIP | ||
sessionAffinity: None | ||
status: | ||
loadBalancer: {} |
21 changes: 21 additions & 0 deletions
21
install/0000_30_machine-api-operator_14_ironic-exporter-servicemonitor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
labels: | ||
app: ironic-exporter | ||
name: metal3-baremetalhost-controller | ||
namespace: openshift-machine-api | ||
spec: | ||
endpoints: | ||
- port: "9608-tcp" | ||
scheme: http | ||
path: /metrics | ||
targetPort: 9608 | ||
jobLabel: app | ||
namespaceSelector: | ||
matchNames: | ||
- metal3-baremetalhost-controller | ||
selector: | ||
matchLabels: | ||
app: ironic-exporter |
17 changes: 17 additions & 0 deletions
17
install/0000_30_machine-api-operator_15_ironic-exporter-prometheusrules.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: metal3-baremetalhost-controller | ||
namespace: openshift-machine-api | ||
spec: | ||
groups: | ||
- name: metal3-baremetalhost-controller | ||
rules: | ||
- alert: HighCPUTemperature | ||
annotations: | ||
summary: "The baremetal node {{ $labels.node_name }} CPU {{ $labels.entity_id }} is too high" | ||
description: "The baremetal node {{ $labels.node_name }} CPU {{ $labels.entity_id }} is too high in the past minute. Last measurement {{ $value }}" | ||
expr: baremetal_temp_celsius > 40 | ||
for: 1m | ||
labels: | ||
severity: warning |