问题
I'm using nodegroups into my terraform script and I was wondering how can I set the name of instances from nodegroups:
resource "aws_eks_node_group" "node_group" {
count = length(var.public_subnet_ids)
cluster_name = aws_eks_cluster.cluster.name
node_group_name = "node-group-${count.index}"
node_role_arn = aws_iam_role.nodes.arn
subnet_ids = [var.public_subnet_ids[count.index]]
instance_types = [var.node-instance-type]
...
}
Without nodegroups I was doing:
resource "aws_launch_configuration" "nodes" {
name_prefix = var.cluster-name
}
来源:https://stackoverflow.com/questions/60004229/define-node-names-from-node-groups