- Newest
- Most votes
- Most comments
Unfortunately, there is no direct option to assign a static or custom DNS name to an Application Load Balancer (ALB) when creating it. ALBs are indeed assigned a default DNS name by AWS, which follows the format: name-id.elb.region.amazonaws.com. This DNS name is dynamically generated and changes each time you create a new ALB.
To address your scenario with EKS and Kubernetes where you're repeatedly creating and deleting clusters for testing, there are a couple of approaches you can consider:
-
Use a custom domain name: Instead of relying on the ALB's default DNS name, you can create a custom domain name and associate it with your ALB. This way, you can keep your custom domain name consistent even when the underlying ALB changes. You would need to update the DNS record (preferably an alias record if using Route 53) each time you create a new ALB, but your application and external references can continue using the same custom domain.
-
Use Amazon Route 53 with alias records: If you're using Route 53 as your DNS service, you can create an alias record that points to your ALB. Alias records have the advantage of being able to point directly to AWS resources like ALBs, and they're free of charge for AWS resource targets. You would still need to update this alias record when you recreate your ALB, but it provides a stable DNS name for your applications to use.
While it's not possible to set a static DNS name directly on the ALB, these approaches can help you maintain a consistent DNS name for your applications, even as the underlying ALB changes. As for opening an issue with aws-load-balancer-controller, while it's a good idea to suggest the feature, the core limitation is at the ALB level rather than the controller level.
Remember, ALBs are designed to be highly available and scalable, which is why they use DNS names that can resolve to multiple IP addresses behind the scenes, rather than static IP addresses or DNS names.
Sources
Application Load Balancers - Elastic Load Balancing
DNS record in Rouet53 for ALB | AWS re:Post
Configure a custom domain name for your Classic Load Balancer - Elastic Load Balancing
Thanks for the reply. I guess both of those answer 1. and 2. include "You would still need to update..." So something extra always needs to be done.
Relevant content
- asked 2 years ago
- asked 4 years ago
