Skip to content

Commit 41b6e16

Browse files
committed
Update Control Plane replica validation for Single Node OpenShift
Installer can be used to provision Single Node OpenShift(SNO) only on AWS, GCP, Azure, PowerVS and Baremetal platforms. SNO is not supported on all on-prem platforms yet. Even on the platforms that support SNO installs, the install method currently supported are assisted/agent/ZTP.
1 parent 9d85a87 commit 41b6e16

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

pkg/asset/machines/master.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,17 @@ func (m *Master) Generate(ctx context.Context, dependencies asset.Parents) error
185185
var ipClaims []ipamv1.IPAddressClaim
186186
var ipAddrs []ipamv1.IPAddress
187187
var controlPlaneMachineSet *machinev1.ControlPlaneMachineSet
188+
189+
// Check if SNO topology is supported on this platform
190+
if pool.Replicas != nil && *pool.Replicas == 1 {
191+
bootstrapInPlace := false
192+
if ic.BootstrapInPlace != nil {
193+
bootstrapInPlace = true
194+
}
195+
if !supportedSingleNodePlatform(bootstrapInPlace, ic.Platform.Name()) {
196+
return fmt.Errorf("this install method does not support Single Node installation on platform %s", ic.Platform.Name())
197+
}
198+
}
188199
switch ic.Platform.Name() {
189200
case awstypes.Name:
190201
subnets, err := aws.MachineSubnetsByZones(ctx, installConfig, awstypes.ClusterNodeSubnetRole)
@@ -967,6 +978,20 @@ func IsFencingCredentialsFile(filepath string) (bool, error) {
967978
if err != nil {
968979
return false, err
969980
}
970-
971981
return match, nil
972982
}
983+
984+
// supportedSingleNodePlatform indicates if the IPI Installer can be used to install SNO on
985+
// a platform.
986+
func supportedSingleNodePlatform(bootstrapInPlace bool, platformName string) bool {
987+
switch platformName {
988+
case awstypes.Name, gcptypes.Name, azuretypes.Name, powervstypes.Name:
989+
// Single node OpenShift installations supported without `bootstrapInPlace`
990+
return true
991+
case nonetypes.Name, externaltypes.Name:
992+
// Single node OpenShift installations supported with `bootstrapInPlace`
993+
return bootstrapInPlace
994+
default:
995+
return false
996+
}
997+
}

0 commit comments

Comments
 (0)