Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6286,9 +6286,8 @@ spec:
Default is qemu:///system
type: string
loadBalancer:
description: |-
LoadBalancer defines how the load balancer used by the cluster is configured.
LoadBalancer is available in TechPreview.
description: LoadBalancer defines how the load balancer used by
the cluster is configured.
properties:
type:
default: OpenShiftManagedDefault
Expand Down Expand Up @@ -7280,9 +7279,8 @@ spec:
maxItems: 2
type: array
loadBalancer:
description: |-
LoadBalancer defines how the load balancer used by the cluster is configured.
LoadBalancer is available in TechPreview.
description: LoadBalancer defines how the load balancer used by
the cluster is configured.
properties:
type:
default: OpenShiftManagedDefault
Expand Down Expand Up @@ -7847,9 +7845,8 @@ spec:
maxItems: 2
type: array
loadBalancer:
description: |-
LoadBalancer defines how the load balancer used by the cluster is configured.
LoadBalancer is available in TechPreview.
description: LoadBalancer defines how the load balancer used by
the cluster is configured.
properties:
type:
default: OpenShiftManagedDefault
Expand Down Expand Up @@ -8637,9 +8634,8 @@ spec:
maxItems: 2
type: array
loadBalancer:
description: |-
LoadBalancer defines how the load balancer used by the cluster is configured.
LoadBalancer is available in TechPreview.
description: LoadBalancer defines how the load balancer used by
the cluster is configured.
properties:
type:
default: OpenShiftManagedDefault
Expand Down
5 changes: 0 additions & 5 deletions pkg/asset/agent/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,6 @@ func warnUnusedConfig(installConfig *types.InstallConfig) {
logrus.Warnf("%s: %s is ignored", fieldPath, vspherePlatform.DiskType)
}

if vspherePlatform.LoadBalancer != nil && !reflect.DeepEqual(*vspherePlatform.LoadBalancer, configv1.VSpherePlatformLoadBalancer{}) {
fieldPath := vsPath.Child("loadBalancer")
logrus.Warnf("%s: %v is ignored", fieldPath, vspherePlatform.LoadBalancer)
}

if len(vspherePlatform.Hosts) > 1 {
fieldPath := vsPath.Child("hosts")
logrus.Warnf("%s: %v is ignored", fieldPath, vspherePlatform.Hosts)
Expand Down
17 changes: 17 additions & 0 deletions pkg/asset/agent/manifests/agentclusterinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ func (a *AgentClusterInstall) Generate(_ context.Context, dependencies asset.Par
agentClusterInstall.Spec.IngressVIPs = installConfig.Config.Platform.BareMetal.IngressVIPs
agentClusterInstall.Spec.APIVIP = installConfig.Config.Platform.BareMetal.APIVIPs[0]
agentClusterInstall.Spec.IngressVIP = installConfig.Config.Platform.BareMetal.IngressVIPs[0]
if installConfig.Config.Platform.BareMetal.LoadBalancer != nil {
agentClusterInstall.Spec.LoadBalancer = &hiveext.LoadBalancer{
Type: loadBalancerType(installConfig.Config.Platform.BareMetal.LoadBalancer.Type),
}
}
} else if installConfig.Config.Platform.VSphere != nil {
vspherePlatform := vsphere.Platform{}
if len(installConfig.Config.Platform.VSphere.APIVIPs) > 1 {
Expand Down Expand Up @@ -341,6 +346,11 @@ func (a *AgentClusterInstall) Generate(_ context.Context, dependencies asset.Par
}
agentClusterInstall.Spec.APIVIPs = installConfig.Config.Platform.VSphere.APIVIPs
agentClusterInstall.Spec.IngressVIPs = installConfig.Config.Platform.VSphere.IngressVIPs
if installConfig.Config.Platform.VSphere.LoadBalancer != nil {
agentClusterInstall.Spec.LoadBalancer = &hiveext.LoadBalancer{
Type: loadBalancerType(installConfig.Config.Platform.VSphere.LoadBalancer.Type),
}
}
} else if installConfig.Config.Platform.Nutanix != nil {
icNutanixPlatformBytes, err := json.Marshal(*installConfig.Config.Platform.Nutanix)
if err != nil {
Expand Down Expand Up @@ -641,6 +651,13 @@ func (a *AgentClusterInstall) GetExternalPlatformName() string {
return ""
}

func loadBalancerType(lbType configv1.PlatformLoadBalancerType) hiveext.LoadBalancerType {
if lbType == configv1.LoadBalancerTypeUserManaged {
return hiveext.LoadBalancerTypeUserManaged
}
return hiveext.LoadBalancerTypeClusterManaged
}

func (a *AgentClusterInstall) validateDiskEncryption() field.ErrorList {
var allErrs field.ErrorList
supportedEnableOn := []string{models.DiskEncryptionEnableOnNone, models.DiskEncryptionEnableOnAll, models.DiskEncryptionEnableOnMasters, models.DiskEncryptionEnableOnWorkers}
Expand Down
50 changes: 50 additions & 0 deletions pkg/asset/agent/manifests/agentclusterinstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/openshift/installer/pkg/ipnet"
"github.com/openshift/installer/pkg/types"
externaltype "github.com/openshift/installer/pkg/types/external"
vspheretype "github.com/openshift/installer/pkg/types/vsphere"
)

func TestAgentClusterInstall_Generate(t *testing.T) {
Expand Down Expand Up @@ -161,6 +162,35 @@ func TestAgentClusterInstall_Generate(t *testing.T) {
goodArbiterACI.Spec.ProvisionRequirements.ArbiterAgents = 1
goodArbiterACI.Spec.ProvisionRequirements.WorkerAgents = 0

installConfigBaremetalUserManagedLB := getValidOptionalInstallConfig()
installConfigBaremetalUserManagedLB.Config.Platform.BareMetal.LoadBalancer = &configv1.BareMetalPlatformLoadBalancer{
Type: configv1.LoadBalancerTypeUserManaged,
}

goodBaremetalUserManagedLBACI := getGoodACI()
goodBaremetalUserManagedLBACI.Spec.LoadBalancer = &hiveext.LoadBalancer{
Type: hiveext.LoadBalancerTypeUserManaged,
}

installConfigVSphereUserManagedLB := getValidOptionalInstallConfig()
installConfigVSphereUserManagedLB.Config.Platform = types.Platform{
VSphere: &vspheretype.Platform{
APIVIPs: []string{"192.168.122.10"},
IngressVIPs: []string{"192.168.122.11"},
LoadBalancer: &configv1.VSpherePlatformLoadBalancer{
Type: configv1.LoadBalancerTypeUserManaged,
},
},
}

goodVSphereUserManagedLBACI := getGoodACI()
goodVSphereUserManagedLBACI.Spec.APIVIP = ""
goodVSphereUserManagedLBACI.Spec.IngressVIP = ""
goodVSphereUserManagedLBACI.Spec.PlatformType = hiveext.VSpherePlatformType
goodVSphereUserManagedLBACI.Spec.LoadBalancer = &hiveext.LoadBalancer{
Type: hiveext.LoadBalancerTypeUserManaged,
}

cases := []struct {
name string
dependencies []asset.Asset
Expand Down Expand Up @@ -337,6 +367,26 @@ func TestAgentClusterInstall_Generate(t *testing.T) {
},
expectedConfig: goodArbiterACI,
},
{
name: "valid configuration baremetal user-managed load balancer",
dependencies: []asset.Asset{
&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
installConfigBaremetalUserManagedLB,
&agentconfig.AgentHosts{},
&agentconfig.AgentConfig{},
},
expectedConfig: goodBaremetalUserManagedLBACI,
},
{
name: "valid configuration vsphere user-managed load balancer",
dependencies: []asset.Asset{
&workflow.AgentWorkflow{Workflow: workflow.AgentWorkflowTypeInstall},
installConfigVSphereUserManagedLB,
&agentconfig.AgentHosts{},
&agentconfig.AgentConfig{},
},
expectedConfig: goodVSphereUserManagedLBACI,
},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion pkg/types/baremetal/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ type Platform struct {
BootstrapExternalStaticGateway string `json:"bootstrapExternalStaticGateway,omitempty"`

// LoadBalancer defines how the load balancer used by the cluster is configured.
// LoadBalancer is available in TechPreview.
// +optional
LoadBalancer *configv1.BareMetalPlatformLoadBalancer `json:"loadBalancer,omitempty"`

Expand Down
1 change: 0 additions & 1 deletion pkg/types/nutanix/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ type Platform struct {
SubnetUUIDs []string `json:"subnetUUIDs"`

// LoadBalancer defines how the load balancer used by the cluster is configured.
// LoadBalancer is available in TechPreview.
// +optional
LoadBalancer *configv1.NutanixPlatformLoadBalancer `json:"loadBalancer,omitempty"`

Expand Down
1 change: 0 additions & 1 deletion pkg/types/ovirt/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ type Platform struct {
AffinityGroups []AffinityGroup `json:"affinityGroups"`

// LoadBalancer defines how the load balancer used by the cluster is configured.
// LoadBalancer is available in TechPreview.
// +optional
LoadBalancer *configv1.OvirtPlatformLoadBalancer `json:"loadBalancer,omitempty"`
}
Expand Down
1 change: 0 additions & 1 deletion pkg/types/vsphere/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ type Platform struct {
NodeNetworking *configv1.VSpherePlatformNodeNetworking `json:"nodeNetworking,omitempty"`

// LoadBalancer defines how the load balancer used by the cluster is configured.
// LoadBalancer is available in TechPreview.
// +optional
LoadBalancer *configv1.VSpherePlatformLoadBalancer `json:"loadBalancer,omitempty"`

Expand Down