terraform-aws-eks-blueprints icon indicating copy to clipboard operation
terraform-aws-eks-blueprints copied to clipboard

Create subnets with resource based hostnames

Open rothgar opened this issue 2 years ago • 4 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

What is the outcome that you are trying to reach?

Subnets created with blueprints should use resource based names for instances. This will allow Kubernetes nodes to have names that reflect their names in ec2 instead of the private IPv4 addresses

More info here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-naming.html

k get no
NAME                                             STATUS     ROLES    AGE     VERSION
i-09e0ab41a603abb0d.us-east-2.compute.internal   NotReady   <none>   4s      v1.24.10-eks-48e63af
i-0b3c0d675c5010751.us-east-2.compute.internal   NotReady   <none>   4s      v1.24.10-eks-48e63af
ip-192-168-105-197.us-east-2.compute.internal    Ready      <none>   7d20h   v1.24.10-eks-48e63af
ip-192-168-163-0.us-east-2.compute.internal      Ready      <none>   7d20h   v1.24.10-eks-48e63af

Describe the solution you would like

Creating a subnet with blueprints has this option enabled or exposed for customers. Examples should be updated to use this setting.

Describe alternatives you have considered

Changing hostnames in userdata or after the node is provisioned is not as consistent as doing it at the subnet level.

Additional context

This is a fairly new feature via https://github.com/aws/containers-roadmap/issues/1723

rothgar avatar Feb 24 '23 22:02 rothgar

Hi @rothgar, for this, first the support needs to be implemented in the VPC module. They are tracking it here. I will leave this issue open and will update our examples when upstream feature is available.

askulkarni2 avatar Mar 15 '23 22:03 askulkarni2

this will be added in v4 here https://github.com/terraform-aws-modules/terraform-aws-vpc/pull/838

bryantbiggs avatar Mar 17 '23 13:03 bryantbiggs

this is now supported in v4.0.0 of the VPC module

bryantbiggs avatar Apr 10 '23 15:04 bryantbiggs

and this should now be available in EKS https://github.com/awsdocs/amazon-eks-user-guide/pull/722

bryantbiggs avatar May 02 '23 17:05 bryantbiggs