Joshua Restivo
Joshua Restivo

Reputation: 1

Use existing AWS NLB with kubernetes ingress

I'm trying deploy an app that uses a nodeport ingress to register with an existing AWS NLB. I t's my understanding that I don't need an lb controller because the NLB is pre-existing and I'm not relying upon it to deploy the NLB. Is this much correct?

Ultimately, I think I just need an annotation in the ingress to tether it to the existing NLB . Am I on the right track?

Upvotes: 0

Views: 2756

Answers (1)

Adiii
Adiii

Reputation: 59896

uses a nodeport ingress to register with an existing AWS NLB

Node port and ingress are two different things, plus How the dynamic node will be managed and how the target will be set for the NLB? Plus node port is not recommended think-nodeport-kubernetes

So the best option is to use an ingress controller with NLB.

All you need to apply this, this will create NLB and ingress, you can also release existing static IP from the NLB and assign it to the new created NLB

 kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.0/deploy/static/provider/aws/deploy.yaml

This is how it will look like

enter image description here

network-load-balancer-nginx-ingress-controller-eks

By doing this, you do not need any fancy annotation for the LB as well, so just create ingress and it should work

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - anthonycornell.com
    secretName: tls-secret
  rules:
  - host: anthonycornell.com
    http:
      paths:
        - path: /apple
          backend:
            serviceName: apple-service
            servicePort: 5678
        - path: /banana
          backend:
            serviceName: banana-service
            servicePort: 5678

Make sure to update DNS that pointing to NLB

Upvotes: 1

Related Questions