Reputation: 1
I am creating an EKS managed node group in terraform using the eks module version 17.1.0 and up until now specifying the bootstrap_extra_args like so has been working
node_groups = [{
name = "${var.environment}-nodes"
desired_capacity = var.eks_cluster.desired_capacity
max_capacity = var.eks_cluster.max_capacity
min_capacity = var.eks_cluster.min_capacity
additional_security_group_ids = aws_security_group.nodes.id
instance_types = [var.eks_cluster.node_instance_type]
key_name = "$$$$$$"
bootstrap_extra_args = "/etc/eks/bootstrap.sh '${local.cluster_name}' --use-max-pods false --kubelet-extra-args '--max-pods=110'"
}]
I have created two clusters like this and the nodes have been created with the max pods set to 110. both of these clusters are in us-east-2
I am now trying to create a cluster in China region cn-northwest-1 and the same configuration only sets the max pods to 35 and I cannot seem to get it to go any higher.
Node types: t3a.large instances
Note: I have also attempted to launch the nodes in China with a launch_template containing the following userdata script and the script is read, there are no errors that I can find and I end up with the same result.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="//"
--//
Content-Type: text/x-shellscript; charset="us-ascii"
#!/bin/bash -xe
/etc/eks/bootstrap.sh '${cluster_name}' --use-max-pods false --kubelet-extra-args '--max-pods=110'
--//--
This begs the question, are eks managed node groups setup a bit differently in china? Is what I'm trying to do even possible without some crazy workaround I cannot seem to find?
Upvotes: 0
Views: 1001
Reputation: 1
After further testing, contrary to terraform documentation, the above definition of bootstrap_extra_args does not work and terraform does not recognize the parameter even though it does not throw any errors. The correct method is through the Launch_template set the following script in userdata
bootstrap_extra_args = "${local.cluster_name} --b64-cluster-ca ${module.eks.cluster_certificate_authority_data} --apiserver-endpoint ${module.eks.cluster_endpoint} --use-max-pods false"
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="//"
--//
Content-Type: text/x-shellscript; charset="us-ascii"
#!/bin/bash
set -ex
/etc/eks/bootstrap.sh ${bootstrap_extra_args}
--//--
without including -max-pods it will automatically set the max pods to 110
Upvotes: 0