mirror of https://github.com/kubernetes/kops.git
Merge pull request #14473 from hakman/aws_healthcheck_interval
aws: Set the target group health check interval to 10s
This commit is contained in:
commit
c066b44934
|
|
@ -278,6 +278,7 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {
|
||||||
Tags: tcpGroupTags,
|
Tags: tcpGroupTags,
|
||||||
Protocol: fi.String("TCP"),
|
Protocol: fi.String("TCP"),
|
||||||
Port: fi.Int64(443),
|
Port: fi.Int64(443),
|
||||||
|
Interval: fi.Int64(10),
|
||||||
HealthyThreshold: fi.Int64(2),
|
HealthyThreshold: fi.Int64(2),
|
||||||
UnhealthyThreshold: fi.Int64(2),
|
UnhealthyThreshold: fi.Int64(2),
|
||||||
Shared: fi.Bool(false),
|
Shared: fi.Bool(false),
|
||||||
|
|
@ -300,6 +301,7 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {
|
||||||
Tags: tlsGroupTags,
|
Tags: tlsGroupTags,
|
||||||
Protocol: fi.String("TLS"),
|
Protocol: fi.String("TLS"),
|
||||||
Port: fi.Int64(443),
|
Port: fi.Int64(443),
|
||||||
|
Interval: fi.Int64(10),
|
||||||
HealthyThreshold: fi.Int64(2),
|
HealthyThreshold: fi.Int64(2),
|
||||||
UnhealthyThreshold: fi.Int64(2),
|
UnhealthyThreshold: fi.Int64(2),
|
||||||
Shared: fi.Bool(false),
|
Shared: fi.Bool(false),
|
||||||
|
|
|
||||||
|
|
@ -556,6 +556,7 @@ resource "aws_lb_listener" "api-complex-example-com-8443" {
|
||||||
resource "aws_lb_target_group" "tcp-complex-example-com-vpjolq" {
|
resource "aws_lb_target_group" "tcp-complex-example-com-vpjolq" {
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 2
|
||||||
|
interval = 10
|
||||||
protocol = "TCP"
|
protocol = "TCP"
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 2
|
||||||
}
|
}
|
||||||
|
|
@ -575,6 +576,7 @@ resource "aws_lb_target_group" "tcp-complex-example-com-vpjolq" {
|
||||||
resource "aws_lb_target_group" "tls-complex-example-com-5nursn" {
|
resource "aws_lb_target_group" "tls-complex-example-com-5nursn" {
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 2
|
||||||
|
interval = 10
|
||||||
protocol = "TCP"
|
protocol = "TCP"
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -493,6 +493,7 @@ resource "aws_lb_listener" "api-minimal-ipv6-example-com-443" {
|
||||||
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 2
|
||||||
|
interval = 10
|
||||||
protocol = "TCP"
|
protocol = "TCP"
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,7 @@ resource "aws_lb_listener" "api-minimal-ipv6-example-com-443" {
|
||||||
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 2
|
||||||
|
interval = 10
|
||||||
protocol = "TCP"
|
protocol = "TCP"
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -556,6 +556,7 @@ resource "aws_lb_listener" "api-minimal-ipv6-example-com-443" {
|
||||||
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 2
|
||||||
|
interval = 10
|
||||||
protocol = "TCP"
|
protocol = "TCP"
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -505,6 +505,7 @@ resource "aws_lb_listener" "api-minimal-ipv6-example-com-443" {
|
||||||
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
resource "aws_lb_target_group" "tcp-minimal-ipv6-example--bne5ih" {
|
||||||
health_check {
|
health_check {
|
||||||
healthy_threshold = 2
|
healthy_threshold = 2
|
||||||
|
interval = 10
|
||||||
protocol = "TCP"
|
protocol = "TCP"
|
||||||
unhealthy_threshold = 2
|
unhealthy_threshold = 2
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ type TargetGroup struct {
|
||||||
// Shared is set if this is an external LB (one we don't create or own)
|
// Shared is set if this is an external LB (one we don't create or own)
|
||||||
Shared *bool
|
Shared *bool
|
||||||
|
|
||||||
|
Interval *int64
|
||||||
HealthyThreshold *int64
|
HealthyThreshold *int64
|
||||||
UnhealthyThreshold *int64
|
UnhealthyThreshold *int64
|
||||||
}
|
}
|
||||||
|
|
@ -88,10 +89,14 @@ func (e *TargetGroup) Find(c *fi.Context) (*TargetGroup, error) {
|
||||||
Port: tg.Port,
|
Port: tg.Port,
|
||||||
Protocol: tg.Protocol,
|
Protocol: tg.Protocol,
|
||||||
ARN: tg.TargetGroupArn,
|
ARN: tg.TargetGroupArn,
|
||||||
|
Interval: tg.HealthCheckIntervalSeconds,
|
||||||
HealthyThreshold: tg.HealthyThresholdCount,
|
HealthyThreshold: tg.HealthyThresholdCount,
|
||||||
UnhealthyThreshold: tg.UnhealthyThresholdCount,
|
UnhealthyThreshold: tg.UnhealthyThresholdCount,
|
||||||
VPC: &VPC{ID: tg.VpcId},
|
VPC: &VPC{ID: tg.VpcId},
|
||||||
}
|
}
|
||||||
|
// Interval cannot be changed after TargetGroup creation
|
||||||
|
e.Interval = actual.Interval
|
||||||
|
|
||||||
e.ARN = tg.TargetGroupArn
|
e.ARN = tg.TargetGroupArn
|
||||||
|
|
||||||
tagsResp, err := cloud.ELBV2().DescribeTags(&elbv2.DescribeTagsInput{
|
tagsResp, err := cloud.ELBV2().DescribeTags(&elbv2.DescribeTagsInput{
|
||||||
|
|
@ -215,6 +220,7 @@ type terraformTargetGroup struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type terraformTargetGroupHealthCheck struct {
|
type terraformTargetGroupHealthCheck struct {
|
||||||
|
Interval int64 `cty:"interval"`
|
||||||
HealthyThreshold int64 `cty:"healthy_threshold"`
|
HealthyThreshold int64 `cty:"healthy_threshold"`
|
||||||
UnhealthyThreshold int64 `cty:"unhealthy_threshold"`
|
UnhealthyThreshold int64 `cty:"unhealthy_threshold"`
|
||||||
Protocol string `cty:"protocol"`
|
Protocol string `cty:"protocol"`
|
||||||
|
|
@ -237,6 +243,7 @@ func (_ *TargetGroup) RenderTerraform(t *terraform.TerraformTarget, a, e, change
|
||||||
VPCID: *e.VPC.TerraformLink(),
|
VPCID: *e.VPC.TerraformLink(),
|
||||||
Tags: e.Tags,
|
Tags: e.Tags,
|
||||||
HealthCheck: terraformTargetGroupHealthCheck{
|
HealthCheck: terraformTargetGroupHealthCheck{
|
||||||
|
Interval: *e.Interval,
|
||||||
HealthyThreshold: *e.HealthyThreshold,
|
HealthyThreshold: *e.HealthyThreshold,
|
||||||
UnhealthyThreshold: *e.UnhealthyThreshold,
|
UnhealthyThreshold: *e.UnhealthyThreshold,
|
||||||
Protocol: elbv2.ProtocolEnumTcp,
|
Protocol: elbv2.ProtocolEnumTcp,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue