Difference between revisions of "Eks-cluster.tf (version 18.26.6)"
Jump to navigation
Jump to search
(29 intermediate revisions by 6 users not shown) | |||
Line 4: | Line 4: | ||
module "eks" { | module "eks" { | ||
− | source = "terraform-aws-modules/eks/aws" | + | source = "[[terraform-aws-modules/eks/aws]]" |
version = "18.26.6" | version = "18.26.6" | ||
cluster_name = local.cluster_name | cluster_name = local.cluster_name | ||
− | [[cluster_version]] = "1.22" | + | [[cluster_version]] = "[[1.22]]" |
− | vpc_id = module.vpc.vpc_id | + | [[vpc_id]] = module.vpc.vpc_id |
− | subnet_ids = module.vpc.private_subnets | + | [[subnet_ids]] = [[module.vpc]].private_subnets |
[[eks_managed_node_group_defaults]] = { | [[eks_managed_node_group_defaults]] = { | ||
− | ami_type = "AL2_x86_64" | + | [[ami_type]] = "[[AL2_x86_64]]" |
− | attach_cluster_primary_security_group = true | + | [[attach_cluster_primary_security_group]] = true |
# Disabling and using externally provided security groups | # Disabling and using externally provided security groups | ||
− | create_security_group = false | + | [[create_security_group]] = false |
} | } | ||
− | eks_managed_node_groups = { | + | [[eks_managed_node_groups]] = { |
one = { | one = { | ||
name = "node-group-1" | name = "node-group-1" | ||
− | instance_types = ["[[t3.small]]"] | + | [[instance_types]] = ["[[t3.small]]"] |
min_size = 1 | min_size = 1 | ||
max_size = 3 | max_size = 3 | ||
− | desired_size = 2 | + | [[desired_size]] = 2 |
− | + | ||
− | pre_bootstrap_user_data = <<-EOT | + | [[pre_bootstrap_user_data]] = <<-[[EOT]] |
echo 'foo bar' | echo 'foo bar' | ||
EOT | EOT | ||
− | + | ||
− | vpc_security_group_ids = [ | + | [[vpc_security_group_ids]] = [ |
aws_security_group.node_group_one.id | aws_security_group.node_group_one.id | ||
] | ] | ||
} | } | ||
− | + | ||
two = { | two = { | ||
name = "node-group-2" | name = "node-group-2" | ||
− | + | ||
instance_types = ["t3.medium"] | instance_types = ["t3.medium"] | ||
− | + | ||
min_size = 1 | min_size = 1 | ||
max_size = 2 | max_size = 2 | ||
desired_size = 1 | desired_size = 1 | ||
− | + | ||
pre_bootstrap_user_data = <<-EOT | pre_bootstrap_user_data = <<-EOT | ||
echo 'foo bar' | echo 'foo bar' | ||
EOT | EOT | ||
− | + | ||
vpc_security_group_ids = [ | vpc_security_group_ids = [ | ||
aws_security_group.node_group_two.id | aws_security_group.node_group_two.id | ||
Line 62: | Line 62: | ||
− | + | == Related == | |
+ | * <code>[[gke.tf]]</code> | ||
+ | * FAQ: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/faq.md#how-do-i-safely-remove-old-worker-groups | ||
+ | * <code>[[worker_groups]]</code> | ||
+ | * <code>[[capacity_type]] = "[[SPOT]]"</code> | ||
== See also == | == See also == | ||
− | * {{ | + | * {{tf eks module}} |
* {{Terraform EKS}} | * {{Terraform EKS}} | ||
− | |||
− | |||
[[Category:EKS]] | [[Category:EKS]] | ||
[[Category:Terraform]] | [[Category:Terraform]] |
Latest revision as of 21:30, 11 February 2024
module "eks" { source = "terraform-aws-modules/eks/aws" version = "18.26.6" cluster_name = local.cluster_name cluster_version = "1.22" vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets eks_managed_node_group_defaults = { ami_type = "AL2_x86_64" attach_cluster_primary_security_group = true # Disabling and using externally provided security groups create_security_group = false } eks_managed_node_groups = { one = { name = "node-group-1" instance_types = ["t3.small"] min_size = 1 max_size = 3 desired_size = 2 pre_bootstrap_user_data = <<-EOT echo 'foo bar' EOT vpc_security_group_ids = [ aws_security_group.node_group_one.id ] } two = { name = "node-group-2" instance_types = ["t3.medium"] min_size = 1 max_size = 2 desired_size = 1 pre_bootstrap_user_data = <<-EOT echo 'foo bar' EOT vpc_security_group_ids = [ aws_security_group.node_group_two.id ] } } }
Related[edit]
gke.tf
- FAQ: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/faq.md#how-do-i-safely-remove-old-worker-groups
worker_groups
capacity_type = "SPOT"
See also[edit]
- Terraform EKS module:
manage_aws_auth_configmap, create_aws_auth_configmap, aws_auth_roles, aws_auth_users, aws_auth_accounts, module.eks, Amazon EKS Blueprints for Terraform, OIDC
- Terraform EKS, Terraform EKS module, Deploy EKS cluster using Terraform, Terraform EKS apply output,
terraform show, ~/.kube/config
,aws_eks_cluster, aws_eks_addon, module.eks_managed_node_group, eks-cluster.tf, node_groups, worker_groups
Advertising: