Amazon web services 地形水平缩放(节点)
我正在尝试为Terraform设置一个水平scailing策略。 现在我已经定义了Kubernetes HorizontalPodAutoscaler,但它只是 能够管理节点内的吊舱:Amazon web services 地形水平缩放(节点),amazon-web-services,Amazon Web Services,我正在尝试为Terraform设置一个水平scailing策略。 现在我已经定义了Kubernetes HorizontalPodAutoscaler,但它只是 能够管理节点内的吊舱: apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: appname namespace: default spec: scaleTargetRef: apiVersion: apps/v1 k
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: appname
namespace: default
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: appname
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 50
我正在寻找一种解决方案,它将自动增加/减少
集群中的节点(EC2实例)。
我知道AWS自动缩放计划是一个可行的想法。
为了将其与Terraform结合,我定义了Terraform aws自动缩放模块:
不幸的是,它不起作用。有没有其他方法可以达到上述效果
module "asg" {
source = "/root/.terraform.d/plugins/terraform-aws-autoscaling-3.6.0"
name = "service"
# Launch configuration
lc_name = "example-lc"
image_id = "ami-0201410ee251naf87"
instance_type = "t2.micro"
vpc_zone_identifier = [
data.aws_subnet.kube_subnet[0].id,
data.aws_subnet.kube_subnet[1].id,
data.aws_subnet.kube_subnet[2].id,
]
# Auto scaling group
asg_name = "example-asg"
health_check_type = "EC2"
min_size = 1
max_size = 6
desired_capacity = 1
wait_for_capacity_timeout = 0
tags = [
{
key = "Environment"
value = "dev"
propagate_at_launch = true
},
{
key = "Project"
value = "megasecret"
propagate_at_launch = true
},
]
}