Skip to content

Commit 7777cd7

Browse files
committed
feat/elbv2/tg: CAPA changes to set cluster TG health check
CAPA sets the listener protocol and port as the target health check configuration (protocol and port) for all listeners. When the HealthCheckProtocol is set to the LB, only the API's target group will be configured to use the desired protocol. Motivated by keeping the compatibility with Terraform, the upstream PR#4849 has been created to implement the customization for API target group, and more flexibility for the additional listeners. This change sets the health check for all listeners used by Load Balancers managed by CAPA, both primary and secondary, as well the additional listeners for MCS.
1 parent 5d5fe31 commit 7777cd7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

pkg/asset/manifests/aws/cluster.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,26 @@ func GenerateClusterAssets(ic *installconfig.InstallConfig, clusterID *installco
150150
LoadBalancerType: capa.LoadBalancerTypeNLB,
151151
Scheme: &capa.ELBSchemeInternal,
152152
CrossZoneLoadBalancing: true,
153+
HealthCheckProtocol: &capa.ELBProtocolHTTPS,
154+
HealthCheck: &capa.TargetGroupHealthCheckAPISpec{
155+
IntervalSeconds: ptr.To[int64](10),
156+
TimeoutSeconds: ptr.To[int64](10),
157+
ThresholdCount: ptr.To[int64](2),
158+
UnhealthyThresholdCount: ptr.To[int64](2),
159+
},
153160
AdditionalListeners: []capa.AdditionalListenerSpec{
154161
{
155162
Port: 22623,
156163
Protocol: capa.ELBProtocolTCP,
164+
HealthCheck: &capa.TargetGroupHealthCheckAdditionalSpec{
165+
Protocol: ptr.To[string](capa.ELBProtocolHTTPS.String()),
166+
Port: ptr.To[string]("22623"),
167+
Path: ptr.To[string]("/healthz"),
168+
IntervalSeconds: ptr.To[int64](10),
169+
TimeoutSeconds: ptr.To[int64](10),
170+
ThresholdCount: ptr.To[int64](2),
171+
UnhealthyThresholdCount: ptr.To[int64](2),
172+
},
157173
},
158174
},
159175
IngressRules: []capa.IngressRule{
@@ -177,6 +193,13 @@ func GenerateClusterAssets(ic *installconfig.InstallConfig, clusterID *installco
177193
LoadBalancerType: capa.LoadBalancerTypeNLB,
178194
Scheme: &capa.ELBSchemeInternetFacing,
179195
CrossZoneLoadBalancing: true,
196+
HealthCheckProtocol: &capa.ELBProtocolHTTPS,
197+
HealthCheck: &capa.TargetGroupHealthCheckAPISpec{
198+
IntervalSeconds: ptr.To[int64](10),
199+
TimeoutSeconds: ptr.To[int64](10),
200+
ThresholdCount: ptr.To[int64](2),
201+
UnhealthyThresholdCount: ptr.To[int64](2),
202+
},
180203
IngressRules: []capa.IngressRule{
181204
{
182205
Description: "Kubernetes API Server traffic for public access",

0 commit comments

Comments
 (0)