1

I am trying to install ingress-nginx controller using helm chart on AWS k8s cluster. Helm chart.values - https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml

I created a Application load balancer and got the IP.

Modified the chart.values

 service:
enabled: true
# -- If enabled is adding an appProtocol option for Kubernetes service. An appProtocol field replacing annotations that were
# using for setting a backend protocol. Here is an example for AWS: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
# It allows choosing the protocol for each backend specified in the Kubernetes service.
# See the following GitHub issue for more details about the purpose: https://github.com/kubernetes/kubernetes/issues/40244
# Will be ignored for Kubernetes versions older than 1.20
##
appProtocol: true
annotations:
  kubernetes.io/ingress.class: alb 
  alb.ingress.kubernetes.io/scheme: internet-facing
  #alb.ingress.kubernetes.io/target-type: instance 

labels: {}
clusterIP: "XXX.XXX.XXX.XXX"

# -- List of IP addresses at which the controller services are available
## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips
##
externalIPs: []
# -- Used by cloud providers to connect the resulting `LoadBalancer` to a pre-existing static IP according to https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
loadBalancerIP: "XXX.XXX.XXX.XXX"
loadBalancerSourceRanges: []
enableHttp: true
enableHttps: true
ipFamilyPolicy: "SingleStack"
# -- List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically
# based on cluster configuration and the ipFamilyPolicy field.
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
ipFamilies:
  - IPv4
ports:
  http: 80
  https: 443
targetPorts:
  http: http
  https: https
type: LoadBalancer

Installed ingress-nginx

helm upgrade --install ingress-nginx ingress-nginx   --repo https://kubernetes.github.io/ingress-nginx   --namespace ingress-nginx --create-namespace -f values.yaml

I still don't see External-IP assigned.

Raj
  • 41
  • 1
  • 3

1 Answers1

1

If I'm not mistaken, the Nginx Ingress Controller installs in a pod inside the cluster so when it receives front traffic, it will route to the appropiate services as per configuration.

But it will not create any AWS cloud resource outside the cluster, you have to handle that yourself. https://docs.nginx.com/nginx-ingress-controller/intro/how-nginx-ingress-controller-works/

Maybe take a look at the AWS Loab Balancer controller, that using annotations will allow you to provision an ALB or NLB load balancer in your cloud account with all the configuration you need, to then route traffic inside your Kubernetes traffic: https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.5/

Take a look at this brief tutorial for AWS Load Balancer controller including exposing external IP: https://repost.aws/knowledge-center/eks-access-kubernetes-services

vicenteherrera
  • 1,442
  • 17
  • 20
  • Thanks for replying. I am not using EKS. I created 3 ec2 as worker and 1 ec2 as master and setup k8s cluster. I created alb and got the alb ip. I am installing ingress-nginx controller using helm chart and inside chart.yaml I have provided the alb IP to loadBalancerIP, to set as external-ip with required annotation. Not sure what I am missing here. – Raj May 27 '23 at 17:56
  • The example uses EKS but ALB LB Controller is not EKS specific. Ingress-nginx controller sits inside the cluster waiting for traffic to reach it so then it can redirect it to pods. As you are saying, setting up manually an ALB to redirect external traffic to the ingress-nginx is also the right step. Review the ALB config and make sure you are not missing something https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-application-load-balancer.html. You may not need both ALB and ingress-nginx, both are load balancers, it's redundant (but should work). – vicenteherrera May 28 '23 at 11:14