Difference between revisions of "Terraform resource: aws eks node group"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 7: Line 7:
 
* <code>[[scaling_config]]</code>
 
* <code>[[scaling_config]]</code>
  
== Example ==
+
== Examples ==
 
   taint {
 
   taint {
 
     key    = "dedicated"
 
     key    = "dedicated"
Line 13: Line 13:
 
     [[effect]] = "[[NO_SCHEDULE]]"
 
     [[effect]] = "[[NO_SCHEDULE]]"
 
   }
 
   }
 +
 +
== Official example ==
 +
<pre>
 +
resource "aws_eks_node_group" "example" {
 +
  cluster_name    = aws_eks_cluster.example.name
 +
  node_group_name = "example"
 +
  node_role_arn  = aws_iam_role.example.arn
 +
  subnet_ids      = aws_subnet.example[*].id
 +
 +
  scaling_config {
 +
    desired_size = 1
 +
    max_size    = 2
 +
    min_size    = 1
 +
  }
 +
 +
  update_config {
 +
    max_unavailable = 1
 +
  }
 +
 +
  # Ensure that IAM Role permissions are created before and deleted after EKS Node Group handling.
 +
  # Otherwise, EKS will not be able to properly delete EC2 Instances and Elastic Network Interfaces.
 +
  depends_on = [
 +
    aws_iam_role_policy_attachment.example-AmazonEKSWorkerNodePolicy,
 +
    aws_iam_role_policy_attachment.example-AmazonEKS_CNI_Policy,
 +
    aws_iam_role_policy_attachment.example-AmazonEC2ContainerRegistryReadOnly,
 +
  ]
 +
}
 +
</pre>
  
 
== Errors ==
 
== Errors ==

Revision as of 15:34, 20 March 2023

aws_eks_node_group (terraform.io)

Arguments

Examples

 taint {
   key    = "dedicated"
   value  = "gpuGroup"
   effect = "NO_SCHEDULE"
 }

Official example

resource "aws_eks_node_group" "example" {
  cluster_name    = aws_eks_cluster.example.name
  node_group_name = "example"
  node_role_arn   = aws_iam_role.example.arn
  subnet_ids      = aws_subnet.example[*].id

  scaling_config {
    desired_size = 1
    max_size     = 2
    min_size     = 1
  }

  update_config {
    max_unavailable = 1
  }

  # Ensure that IAM Role permissions are created before and deleted after EKS Node Group handling.
  # Otherwise, EKS will not be able to properly delete EC2 Instances and Elastic Network Interfaces.
  depends_on = [
    aws_iam_role_policy_attachment.example-AmazonEKSWorkerNodePolicy,
    aws_iam_role_policy_attachment.example-AmazonEKS_CNI_Policy,
    aws_iam_role_policy_attachment.example-AmazonEC2ContainerRegistryReadOnly,
  ]
}

Errors

Related

See also

  • https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group#taint
  • Advertising: