@@ -52,6 +52,78 @@ Resources:
52
52
Value : owned
53
53
ToPort : 10250
54
54
Type : ' AWS::EC2::SecurityGroupIngress'
55
+ {{- if or (eq .Cluster.ConfigItems.control_plane_load_balancer_internal "pre") (eq .Cluster.ConfigItems.control_plane_load_balancer_internal "serving") (eq .Cluster.ConfigItems.control_plane_load_balancer_internal "active") }}
56
+ ControlPlaneInternalLB :
57
+ Type : AWS::ElasticLoadBalancingV2::LoadBalancer
58
+ Properties :
59
+ Name : " {{.Cluster.LocalID}}-nlb-internal"
60
+ LoadBalancerAttributes :
61
+ - Key : load_balancing.cross_zone.enabled
62
+ Value : true
63
+ Scheme : internal
64
+ Subnets :
65
+ {{ with $values := .Values }}
66
+ {{ range $az := $values.availability_zones }}
67
+ - " {{ index $values.lb_subnets $az }}"
68
+ {{ end }}
69
+ {{ end }}
70
+ Tags :
71
+ - Key : ' kubernetes.io/cluster/{{.Cluster.ID}}'
72
+ Value : owned
73
+ - Key : " component"
74
+ Value : " kube-apiserver"
75
+ Type : network
76
+ ControlPlaneInternalLBTargetGroup :
77
+ Type : AWS::ElasticLoadBalancingV2::TargetGroup
78
+ Properties :
79
+ HealthCheckIntervalSeconds : 10
80
+ HealthCheckPort : 8443
81
+ HealthCheckProtocol : HTTPS
82
+ HealthCheckPath : " /readyz"
83
+ HealthyThresholdCount : 2
84
+ UnhealthyThresholdCount : 2
85
+ Name : " {{.Cluster.LocalID}}-nlb-internal"
86
+ Port : 8443
87
+ Protocol : TLS
88
+ Tags :
89
+ - Key : ' kubernetes.io/cluster/{{.Cluster.ID}}'
90
+ Value : owned
91
+ - Key : " component"
92
+ Value : " kube-apiserver"
93
+ VpcId : " {{.Cluster.ConfigItems.vpc_id}}"
94
+ TargetGroupAttributes :
95
+ - Key : deregistration_delay.timeout_seconds
96
+ Value : 60
97
+ - Key : preserve_client_ip.enabled
98
+ Value : " false"
99
+ ControlPlaneInternalLBListener :
100
+ Type : AWS::ElasticLoadBalancingV2::Listener
101
+ Properties :
102
+ AlpnPolicy :
103
+ - {{ if eq .Cluster.ConfigItems.experimental_nlb_alpn_h2_enabled "true" }}HTTP2Preferred{{else}}None{{end}}
104
+ SslPolicy : " ELBSecurityPolicy-TLS-1-2-2017-01"
105
+ Certificates :
106
+ - CertificateArn : " {{.Values.load_balancer_certificate}}"
107
+ DefaultActions :
108
+ - Type : forward
109
+ TargetGroupArn : !Ref ControlPlaneInternalLBTargetGroup
110
+ LoadBalancerArn : !Ref ControlPlaneInternalLB
111
+ Port : 443
112
+ Protocol : TLS
113
+ ControlPlaneInternalLBVersionDomain :
114
+ Properties :
115
+ AliasTarget :
116
+ DNSName : !GetAtt
117
+ - ControlPlaneInternalLB
118
+ - DNSName
119
+ HostedZoneId : !GetAtt
120
+ - ControlPlaneInternalLB
121
+ - CanonicalHostedZoneID
122
+ HostedZoneName : " {{.Values.hosted_zone}}."
123
+ Name : " {{.Cluster.LocalID}}-internal.{{.Values.hosted_zone}}."
124
+ Type : A
125
+ Type : ' AWS::Route53::RecordSet'
126
+ {{- end }}
55
127
MasterLoadBalancerNLB :
56
128
Type : AWS::ElasticLoadBalancingV2::LoadBalancer
57
129
Properties :
@@ -2503,6 +2575,12 @@ Outputs:
2503
2575
Export :
2504
2576
Name : ' {{.Cluster.ID}}:master-load-balancer-nlb-target-group'
2505
2577
Value : !Ref MasterLoadBalancerNLBTargetGroup
2578
+ {{- if or (eq .Cluster.ConfigItems.control_plane_load_balancer_internal "pre") (eq .Cluster.ConfigItems.control_plane_load_balancer_internal "serving") (eq .Cluster.ConfigItems.control_plane_load_balancer_internal "active") }}
2579
+ ControlPlaneInternalLBTargetGroup :
2580
+ Export :
2581
+ Name : ' {{.Cluster.ID}}:control-plane-internal-lb-target-group'
2582
+ Value : !Ref ControlPlaneInternalLBTargetGroup
2583
+ {{- end }}
2506
2584
MasterSecurityGroup :
2507
2585
Export :
2508
2586
Name : ' {{.Cluster.ID}}:master-security-group'
0 commit comments