chore(metallb): add lb ip on service as annotation

This commit is contained in:
Stavros kois
2023-12-23 17:51:19 +02:00
parent 357c2b243b
commit 84286242f4
2 changed files with 8 additions and 0 deletions

View File

@@ -142,3 +142,8 @@ tests:
app.kubernetes.io/instance: test-release-name
app.kubernetes.io/name: common-test
pod.name: my-workload
- documentIndex: *serviceDoc
isSubset:
path: metadata.annotations
content:
metallb.universe.tf/loadBalancerIPs: "10.100.200.45"

View File

@@ -21,6 +21,9 @@ annotations: The annotations variable reference, to append the MetalLB annotatio
{{- if (hasKey $rootCtx.Values.global "metallb") -}}
{{- if $rootCtx.Values.global.metallb.addServiceAnnotations -}}
{{- $_ := set $annotations "metallb.universe.tf/allow-shared-ip" $sharedKey -}}
{{- if $objectData.loadBalancerIP -}}
{{- $_ := set $annotations "metallb.universe.tf/loadBalancerIPs" (tpl $objectData.loadBalancerIP $rootCtx) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}