diff --git a/metal3-chart/charts/ironic/templates/_helpers.tpl b/metal3-chart/charts/ironic/templates/_helpers.tpl index 0d1ab973..8bce5538 100644 --- a/metal3-chart/charts/ironic/templates/_helpers.tpl +++ b/metal3-chart/charts/ironic/templates/_helpers.tpl @@ -83,3 +83,16 @@ Get ironic CA volumeMounts readOnly: true {{- end }} {{- end }} + +{{/* +Get the formatted "External" hostname or IP address +*/}} +{{- define "ironic.externalHttpHost" }} +{{- with .Values.global }} +{{- if regexMatch ".*:.*" .externalHttpHost }} +{{- print "[" .externalHttpHost "]" }} +{{- else }} +{{- .externalHttpHost }} +{{- end }} +{{- end }} +{{- end }} diff --git a/metal3-chart/charts/ironic/templates/configmap.yaml b/metal3-chart/charts/ironic/templates/configmap.yaml index ba43d206..6e45bd56 100644 --- a/metal3-chart/charts/ironic/templates/configmap.yaml +++ b/metal3-chart/charts/ironic/templates/configmap.yaml @@ -32,7 +32,9 @@ data: {{- else }} {{- $protocol = "http" }} {{- end }} - IRONIC_EXTERNAL_HTTP_URL: {{ $protocol }}://{{ $ironicCacheHost }} + {{- if .Values.global.externalHttpHost }} + IRONIC_EXTERNAL_HTTP_URL: {{ $protocol }}://{{ include "ironic.externalHttpHost" . }}:6385 + {{- end }} DEPLOY_ARCHITECTURE: {{ $deployArch }} IRONIC_BOOT_BASE_URL: {{ $protocol }}://{{ $ironicBootHost }} ENABLE_PXE_BOOT: "{{ .Values.global.enable_pxe_boot }}" diff --git a/metal3-chart/values.yaml b/metal3-chart/values.yaml index 2d24c8a8..d68d6a96 100644 --- a/metal3-chart/values.yaml +++ b/metal3-chart/values.yaml @@ -60,6 +60,9 @@ global: # IP Address assigned to network interface on provisioning network provisioningIP: "" + # Hostname or IP for accessing the Ironic API server from a non-provisioning network + externalHttpHost: "" + # Name for the MariaDB service databaseServiceName: metal3-mariadb