如何解决Spot 实例未加入由 terraform 0.13.5 提供的 aws eks 1.18
问题: 使用 terraform 0.13.5 创建了 eks 1.18 集群,但 Spot 实例未加入集群。
➜ k get nodes
No resources found in default namespace.
➜ terraform -version
terraform v0.13.5
+ provider registry.terraform.io/hashicorp/aws v3.22.0
+ provider registry.terraform.io/hashicorp/kubernetes v1.13.3
+ provider registry.terraform.io/hashicorp/local v2.0.0
+ provider registry.terraform.io/hashicorp/null v3.0.0
+ provider registry.terraform.io/hashicorp/random v2.3.1
+ provider registry.terraform.io/hashicorp/template v2.2.0
module "eks_cluster" {
source = "terraform-aws-modules/eks/aws"
cluster_name = module.eks_label.id
cluster_version = "1.18"
subnets = var.subnets
vpc_id = var.vpc_id
worker_groups_launch_template = [
{
name = "python-spot-pool"
override_instance_types = ["m5.xlarge","m5a.xlarge","m5zn.xlarge"]
spot_instance_pools = 5
asg_max_size = 5
asg_desired_capacity = 2
root_volume_size = 150
root_encrypted = true
Metadata_http_put_response_hop_limit = 10
kubelet_extra_args = "--node-labels=node.kubernetes.io/lifecycle=spot"
public_ip = false
}
]
tags = merge(var.tags,{
created-by = var.created_by
})
}
因此创建了 Spot 实例,但它们没有加入 AWS EKS 集群。
➜ aws ec2 describe-instances G eks
|||| Arn | arn:aws:iam::xxx:instance-profile/team-shared-eks2021010923363674750000000a ||||
||||| GroupName | team-shared-eks20210109232249263900000003 |||||
|||| GroupName | team-shared-eks20210109232249263900000003 ||||
|||| kubernetes.io/cluster/team-shared-eks | owned ||||
|||| Name | team-shared-eks-python-spot-pool-eks_asg ||||
|||| aws:autoscaling:groupName | team-shared-eks-python-spot-pool20210109234259660100000003 ||||
|||| Arn | arn:aws:iam::xxx:instance-profile/team-shared-eks2021010923363674750000000a ||||
||||| GroupName | team-shared-eks20210109232249263900000003 |||||
|||| GroupName | team-shared-eks20210109232249263900000003 ||||
|||| aws:autoscaling:groupName | team-shared-eks-python-spot-pool20210109234259660100000003 ||||
|||| Name | team-shared-eks-python-spot-pool-eks_asg ||||
|||| kubernetes.io/cluster/team-shared-eks | owned
如果我更换
worker_groups_launch_template = [
{
name = "on-demand-pool"
instance_type = "t3.small"
asg_max_size = 1
asg_min_size = 1
asg_desired_capacity = 1
root_volume_size = 150
kubelet_extra_args = "--node-labels=workload=app,tech_stack=PHP"
public_ip = false
},{
name = "python-spot-pool"
override_instance_types = ["m5.xlarge","m5zn.xlarge"]
spot_instance_pools = 5
asg_max_size = 5
asg_desired_capacity = 2
root_volume_size = 150
kubelet_extra_args = "--node-labels=node.kubernetes.io/lifecycle=spot"
public_ip = false
},]
然后我在 eks 集群中只得到一个 t3.small 节点,但同样 - 没有点,但是它们存在于 AWS 帐户中
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。