From dfdfeefe202be9d373e5bc050e8f3ef4af86b3d3 Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Wed, 23 Nov 2022 09:56:54 +0000 Subject: [PATCH] Set ip=dhcp,dhcp6 for master nodes on dualstack We were previously only seting this for workers but its also needed on the master nodes to ensure both networks are ready before ovnkube-node starts. --- .../files/usr/local/bin/startironic.sh.template | 4 +++- pkg/asset/ignition/bootstrap/common.go | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/data/data/bootstrap/baremetal/files/usr/local/bin/startironic.sh.template b/data/data/bootstrap/baremetal/files/usr/local/bin/startironic.sh.template index b4e29013c23..b2ecb299d71 100755 --- a/data/data/bootstrap/baremetal/files/usr/local/bin/startironic.sh.template +++ b/data/data/bootstrap/baremetal/files/usr/local/bin/startironic.sh.template @@ -88,7 +88,9 @@ IPTABLES=ip6tables IPTABLES=iptables {{ end }} -{{ if .UseIPv6ForNodeIP }} +{{ if .UseDualForNodeIP }} +EXTERNAL_IP_OPTIONS="ip=dhcp,dhcp6" +{{ else if .UseIPv6ForNodeIP }} EXTERNAL_IP_OPTIONS="ip=dhcp6" {{ else }} EXTERNAL_IP_OPTIONS="ip=dhcp" diff --git a/pkg/asset/ignition/bootstrap/common.go b/pkg/asset/ignition/bootstrap/common.go index f176a1418a1..bc6faaec804 100644 --- a/pkg/asset/ignition/bootstrap/common.go +++ b/pkg/asset/ignition/bootstrap/common.go @@ -78,6 +78,7 @@ type bootstrapTemplateData struct { PlatformData platformTemplateData BootstrapInPlace *types.BootstrapInPlace UseIPv6ForNodeIP bool + UseDualForNodeIP bool IsFCOS bool IsSCOS bool IsOKD bool @@ -281,6 +282,15 @@ func (a *Common) getTemplateData(dependencies asset.Parents, bootstrapInPlace bo platformFirstAPIVIP := firstAPIVIP(&installConfig.Config.Platform) APIIntVIPonIPv6 := utilsnet.IsIPv6String(platformFirstAPIVIP) + networkStack := 0 + for _, snet := range installConfig.Config.ServiceNetwork { + if snet.IP.To4() != nil { + networkStack |= 1 + } else { + networkStack |= 2 + } + } + // Set cluster profile clusterProfile := "" if cp := os.Getenv("OPENSHIFT_INSTALL_EXPERIMENTAL_CLUSTER_PROFILE"); cp != "" { @@ -308,6 +318,7 @@ func (a *Common) getTemplateData(dependencies asset.Parents, bootstrapInPlace bo ClusterProfile: clusterProfile, BootstrapInPlace: bootstrapInPlaceConfig, UseIPv6ForNodeIP: APIIntVIPonIPv6, + UseDualForNodeIP: networkStack == 3, IsFCOS: installConfig.Config.IsFCOS(), IsSCOS: installConfig.Config.IsSCOS(), IsOKD: installConfig.Config.IsOKD(),