Closed aliartiza75 closed 1 year ago
Your bootstrap_extra_args
setting is inserting a newline at the end due to the use of the Heredoc String:
bootstrap_extra_args = <<-EOT
--kubelet-extra-args '--max-pods=50 --node-labels=apps=true'
EOT
You can see the use of this setting in the template file here: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/templates/linux_user_data.tpl#L12
To fix this, I'd recommend using a simple string. i.e.:
bootstrap_extra_args = "--kubelet-extra-args '--max-pods=50 --node-labels=apps=true'"
Alternately, you could use trimspace or chomp functions to remove the offending newline character. e.g.:
bootstrap_extra_args = chomp(
<<-EOT
--kubelet-extra-args '--max-pods=50 --node-labels=apps=true'
EOT
)
see comments above; we also have examples that demonstrate how to pass in custom/additional user data - this does not appear to be a module issue so I am closing it out for now
thank you @bdalpe and @bryantbiggs
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Description
I am trying to deploy an EKS self_managed_node_group cluster and install some services using pre_bootstrap_user_data but some pre-defined commands are causing the installation to fail.
This is my self managed node group config:
I used the above manifest to provision the cluster. Once the cluster was provisioned, I checked the nodes to see if the utilities were installed. I found out they were not.
I checked the cloud init logs and found out this
Logs:
The content of the
/var/lib/cloud/instance/scripts/part-001
Versions
provider registry.terraform.io/hashicorp/aws v4.67.0 provider registry.terraform.io/hashicorp/cloudinit v2.3.2 provider registry.terraform.io/hashicorp/kubernetes v2.20.0 provider registry.terraform.io/hashicorp/time v0.9.1 provider registry.terraform.io/hashicorp/tls v4.0.4
Reproduction Code [Required]
Using the manifests given above provision an EKS Cluster. Once the nodes are available check the nodes if the utilities are installed. Steps to reproduce the behavior:
Expected behavior
A user should be able to install services using the user data script.
Actual behavior
The user data scripts fail due to the following reason:
Because of the above issues the rest of the commands don't run.
Terminal Output Screenshot(s)
Already provided
Additional context