Ingress-nginx: Resuse existing ELB?

Created on 18 Feb 2019  路  1Comment  路  Source: kubernetes/ingress-nginx

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.):

Yes

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):

loadbalancer
createloadbalancer
elb
etc


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

NGINX Ingress controller version: 0.22.0

Kubernetes version (use kubectl version): 1.11.5

Environment:

  • Cloud provider or hardware configuration: AWS
  • OS (e.g. from /etc/os-release): Amazon Linux 2
  • Kernel (e.g. uname -a): 4.14.88-88.76.amzn2.x86_64
  • Install tools: EKS, CloudFormation
  • Others:

What happened:
I created a cluster with EKS using CloudFormation, then I added ingress-nginx and a couple of ingress resources. This created an ELB. After deleting the CloudFormation stack and re-creating, instead of re-using the existing ELB, a new one is created.

What you expected to happen:
I expect the same ELB to be re-used, since it is tagged with the same values as the new ELB.

How to reproduce it (as minimally and precisely as possible):
Create cluster, add ingress-nginx, add an ingress to create ELB, delete cluster and repeat, a new ELB is created.

Anything else we need to know:
Perhaps this can be achieved with the use of an annotation, but I have so far searched the source code in vain...

Most helpful comment

I expect the same ELB to be re-used, since it is tagged with the same values as the new ELB.

That is not possible. When you create a service type=LoadBalancer, Kubernetes creates a new ELB associated with the service.
If you want to reuse an existing ELB, you need to use a service type=NodePort (similar to baremetal) and add the cluster nodes to the ELB manually (from the AWS console)

Edit: this applies to any service type=LoadBalancer in the cluster

>All comments

I expect the same ELB to be re-used, since it is tagged with the same values as the new ELB.

That is not possible. When you create a service type=LoadBalancer, Kubernetes creates a new ELB associated with the service.
If you want to reuse an existing ELB, you need to use a service type=NodePort (similar to baremetal) and add the cluster nodes to the ELB manually (from the AWS console)

Edit: this applies to any service type=LoadBalancer in the cluster

Was this page helpful?
0 / 5 - 0 ratings