Skip to content

Commit 93a723a

Browse files
authored
Merge pull request openstack-exporter#12 from mlashley/master
Feature: Add multicloud support
2 parents 1bc37f5 + b26de09 commit 93a723a

File tree

4 files changed

+92
-4
lines changed

4 files changed

+92
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
apiVersion: v1
33
name: prometheus-openstack-exporter
4-
version: 0.4.2
5-
appVersion: v1.2.0
4+
version: 0.4.3
5+
appVersion: v1.6.0

charts/prometheus-openstack-exporter/templates/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ spec:
2323
args:
2424
- --endpoint-type
2525
- {{ .Values.endpoint_type }}
26+
{{- if .Values.multicloud.enabled }}
27+
- --multi-cloud
28+
{{- else }}
2629
- {{ .Values.cloud }}
30+
{{- end }}
2731
{{- with .Values.extraArgs }}
2832
{{- . | toYaml | nindent 8 }}
2933
{{- end }}

charts/prometheus-openstack-exporter/templates/servicemonitor.yaml

+59-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1+
{{- if .Values.multicloud.enabled }}
2+
{{- $fullname := include "openstack-exporter.fullname" . }}
3+
{{- $labels := include "openstack-exporter.labels" . }}
4+
{{- range .Values.multicloud.clouds }}
5+
---
6+
apiVersion: monitoring.coreos.com/v1
7+
kind: ServiceMonitor
8+
metadata:
9+
name: {{ $fullname }}-{{ .name }}
10+
namespace: {{ $.Release.Namespace }}
11+
labels:
12+
{{- $labels | indent 4 }}
13+
spec:
14+
endpoints:
15+
- interval: {{ $.Values.serviceMonitor.interval }}
16+
scrapeTimeout: {{ $.Values.serviceMonitor.scrapeTimeout }}
17+
port: metrics
18+
path: /probe
19+
params:
20+
cloud:
21+
- {{ .name }}
22+
include_services:
23+
- {{ join "," .services }}
24+
relabelings:
25+
- action: replace
26+
regex: (.*)
27+
replacement: {{ .name }}
28+
targetLabel: instance
29+
jobLabel: jobLabel
30+
namespaceSelector:
31+
any: true
32+
selector:
33+
matchLabels:
34+
{{- $labels | indent 6 }}
35+
{{- end }}
36+
{{- if .Values.multicloud.selfmonitor }}
37+
---
38+
apiVersion: monitoring.coreos.com/v1
39+
kind: ServiceMonitor
40+
metadata:
41+
name: {{ include "openstack-exporter.fullname" . }}
42+
namespace: {{ .Release.Namespace }}
43+
labels:
44+
{{- include "openstack-exporter.labels" . | indent 4 }}
45+
spec:
46+
endpoints:
47+
- interval: {{ .Values.serviceMonitor.interval }}
48+
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
49+
port: metrics
50+
jobLabel: jobLabel
51+
namespaceSelector:
52+
any: true
53+
selector:
54+
matchLabels:
55+
{{- include "openstack-exporter.labels" . | indent 6 }}
56+
{{- end }}
57+
{{- else }}
158
---
259
apiVersion: monitoring.coreos.com/v1
360
kind: ServiceMonitor
@@ -21,4 +78,5 @@ spec:
2178
any: true
2279
selector:
2380
matchLabels:
24-
{{ include "openstack-exporter.labels" . | indent 6 }}
81+
{{ include "openstack-exporter.labels" . | indent 6 }}
82+
{{- end }}

charts/prometheus-openstack-exporter/values.yaml

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
---
22
# Choose endpoint type (this will override the value of clouds.yaml)
33
endpoint_type: internal
4+
# Ignored when multicloud.enabled: true
45
cloud: default
56

67
replicaCount: 1
78

89
image:
910
repository: quay.io/niedbalski/openstack-exporter-linux-amd64
10-
tag: v1.2.0
11+
tag: v1.6.0
1112
pullPolicy: Always
1213

1314
serviceMonitor:
1415
interval: 1m
1516
scrapeTimeout: 30s
1617

18+
multicloud:
19+
# Enable multicloud (i.e. /probe?... targets)
20+
# Doc: https://github.com/openstack-exporter/openstack-exporter#description
21+
enabled: true
22+
# Monitor the exporter's internal metrics (i.e. /metrics)
23+
selfmonitor: true
24+
# List of clouds to scrape, and the services to scrape from them
25+
clouds:
26+
- name: cloud1
27+
services:
28+
- volume
29+
- name: cloud2
30+
services:
31+
- volume
32+
- image
33+
- identity
34+
- compute
35+
- network
36+
- placement # NB this needs the openstack-exporter release > 1.4.0
37+
1738
# Add extra args to the exporter.
1839
# Doc: https://github.com/openstack-exporter/openstack-exporter#command-line-options
1940
#extraArgs:
@@ -43,3 +64,8 @@ clouds_yaml_config: |
4364
project_domain_name: 'Default'
4465
user_domain_name: 'Default'
4566
auth_url: 'http://your-url-here:5000/v3'
67+
# In case of multicloud.enabled
68+
# cloud1:
69+
# ...
70+
# cloud2:
71+
# ...

0 commit comments

Comments
 (0)