Skip to content

Commit 8ca65d9

Browse files
committed
CORS-2902: capi/aws: add ext-LB as CAPA secondary LB
1 parent deef8f9 commit 8ca65d9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pkg/asset/manifests/aws/cluster.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/openshift/installer/pkg/asset"
1515
"github.com/openshift/installer/pkg/asset/installconfig"
1616
"github.com/openshift/installer/pkg/asset/manifests/capiutils"
17+
"github.com/openshift/installer/pkg/types"
1718
)
1819

1920
// GenerateClusterAssets generates the manifests for the cluster-api.
@@ -173,6 +174,24 @@ func GenerateClusterAssets(installConfig *installconfig.InstallConfig, clusterID
173174
},
174175
}
175176

177+
if installConfig.Config.Publish == types.ExternalPublishingStrategy {
178+
awsCluster.Spec.SecondaryControlPlaneLoadBalancer = &capa.AWSLoadBalancerSpec{
179+
Name: ptr.To(clusterID.InfraID + "-ext"),
180+
LoadBalancerType: capa.LoadBalancerTypeNLB,
181+
Scheme: &capa.ELBSchemeInternetFacing,
182+
CrossZoneLoadBalancing: true,
183+
IngressRules: []capa.IngressRule{
184+
{
185+
Description: "Kubernetes API Server traffic for public access",
186+
Protocol: capa.SecurityGroupProtocolTCP,
187+
FromPort: 6443,
188+
ToPort: 6443,
189+
CidrBlocks: []string{"0.0.0.0/0"},
190+
},
191+
},
192+
}
193+
}
194+
176195
// If the install config has subnets, use them.
177196
if len(installConfig.AWS.Subnets) > 0 {
178197
privateSubnets, err := installConfig.AWS.PrivateSubnets(context.TODO())

0 commit comments

Comments
 (0)