Skip to content

Reducing AWS ELB Costs with Ingress-Nginx #725

Closed

Description

@Rub21

I have been evaluating the ELBs that we are using in the AWS account. Currently, we have reached the maximum usage level of the Classic Load Balancer (layer 7). We can certainly request an increase in the ELB quota on our AWS account. However, since there are more improvements around Kubernetes, there is another option, such as ingress-nginx, that might be better in terms of cost and efficiency.

Currently, our services are deployed on Kubernetes, which creates an ELB (Classic Load Balancer - layer 7) to serve each service. These endpoints have the following format: a2f5cfcb3114947d797....xx.elb.us-east-1.amazonaws.com, and subsequently, these endpoints are assigned to a subdomain, such as nominatim-api.openhistoricalmap.org or nominatim-api-staging.openhistoricalmap.org.

The other option, is to use ingress-nginx, The ingress-nginx in Kubernetes acts as an ingress controller that uses NGINX as a reverse proxy server and load balancer. it works with Network Load Balancer (NLB) (layer 4) in AWS.

The current cost for types of ELB in us-east-1 region.

Load Balancer Type Hourly Rate Per Unit Data
Classic Load Balancer $0.025 $0.008 per GB of data processed
Network Load Balancer $0.0225 $0.006 per NLCU-hour (or partial hour)

Using Network Load Balancer would lead to significant cost reductions because we would need only two NLBs. Instead of having multiple ELBs for different services, we can use a single ingress controller to manage traffic for multiple services. It means we only need to pay for two(production and staging) load balancer instead of several.

I have bee testing it, some of these in development environment here the results,

The only disadvantage would be that some of our endpoints, such as those for the API nominatim-api-staging, will change to nominatim-api.staging. However, the main domains may be a bit tricky, which we could discuss.

cc. @batpad @danrademacher

Activity

  1. added
    infrastructure
    on Mar 23, 2024
  2. batpad commented on Mar 23, 2024

    @batpad

    @Rub21 I don't think it should be a problem for the domains - we can just make separate DNS records for the domains in Route53 and point it to the Cluster IP - like we don't HAVE TO manage the DNS in the ingress controller, it should also be fine to manage DNS in Route53 and point to the Cluster IP (if I'm understanding the issue correctly).

    This is really good work @Rub21 ! Happy to chat next week to outline steps to move to the ingress-nginx controller - in general I think this is a good idea!

  3. 1ec5 commented on Mar 23, 2024

    @1ec5
    Member

    we can just make separate DNS records for the domains in Route53 and point it to the Cluster IP

    I suppose this would make #719 more straightforward too.

  4. moved this from Todo - Known Path to In Progress in OpenHistoricalMap Dev Planningon Mar 27, 2024
  5. Rub21 commented on Mar 28, 2024

    @Rub21
    MemberAuthor

    Progress is happening here: osm-seed/osm-seed#319

  6. moved this from In Progress to On Staging in OpenHistoricalMap Dev Planningon Apr 2, 2024
  7. moved this from On Staging to No status in OpenHistoricalMap Dev Planningon Apr 10, 2024
  8. added theissue type on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

infrastructure

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions