AWS Load Balancer Controller and ALB with Nginx

0

Hi, I have nginx controller running and in front I have CLB that was created by helm chart of Nginx. Now I want to migrate to ALB, as I understand I need somehow map NGINX with ingress. I am using this syntax. It works but it in this case my nginx controller is not used, I want traffic goes to pods through nginx controller. With this yaml it goes directly to pods. Does Nginx can work with ALB? I know it works with NLB.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: alb-ingress-connect-nginx
  namespace: kube-system
  annotations:
    alb.ingress.kubernetes.io/load-balancer-name: alb-ingress # creates ALB
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/healthcheck-port: "30260"
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/healthcheck-path: /healthz
spec:
  ingressClassName: alb
  rules:
    - http:
        paths:
          - path: /first
            pathType: Prefix
            backend:
              service:
                name: first
                port:
                  name: svc-port
          - path: /second
            pathType: Prefix
            backend:
              service:
                name: second
                port:
                  name: svc-port
1 Antwort
1
Akzeptierte Antwort

NGINX can work with an ALB. You just need to ensure the Nodes/IPs are in a target group and you have a Rule on your ALB to forward the webtraffic too.

EDIT Ensure the ALB Target group is configured with the Correct HTTP Ports for your NGINX machines.

profile picture
EXPERTE
beantwortet vor 4 Monaten
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen