Skip to content

Commit f21de47

Browse files
committed
Add IPv6 Support
Because the IPv6 addresses must be specified using '[]' some places need to be adapted: * yaml parses non escaped [sometext] strings as arrays and fails * Colons are not allowed in names Signed-off-by: Andreas Florath <[email protected]>
1 parent 4868d1a commit f21de47

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

helm/templates/servicemonitors.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ spec:
2929
apiVersion: monitoring.coreos.com/v1
3030
kind: ServiceMonitor
3131
metadata:
32-
name: {{ include "redfish_exporter.fullname" $ }}-{{ $host }}
32+
name: {{ include "redfish_exporter.fullname" $ }}-{{ regexReplaceAll ":" $host "-" | trimAll "[]" }}
3333
labels:
3434
{{- include "redfish_exporter.labels" $ | nindent 4 }}
35-
redfish-exporter/host: {{ $host }}
35+
redfish-exporter/host: {{ regexReplaceAll ":" $host "_" | trimAll "[]" }}
3636
spec:
3737
endpoints:
3838
- port: http
3939
interval: {{ $.Values.serviceMonitor.interval }}
4040
params:
4141
target:
42-
- {{ $host }}
42+
- "{{ $host }}"
4343
{{- if $hostConfig.group }}
4444
group:
4545
- {{ $hostConfig.group }}
@@ -48,7 +48,7 @@ spec:
4848
path: /redfish
4949
metricRelabelings:
5050
- targetLabel: instance
51-
replacement: {{ $host }}
51+
replacement: {{ trimAll "[]" $host }}
5252
# (optional) when using group config add this to have group=my_group_name
5353
{{- if $hostConfig.group }}
5454
- targetLabel: instance_group

0 commit comments

Comments
 (0)