Gowmi
Gowmi

Reputation: 611

Install Nginx Ingress Controller using Helm chart

I'm trying to install nginx ingress controller using helm chart, I followed below steps to make LB available in AWS console.

kubectl create ns sony-ingress
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install sony-release ingress-nginx/ingress-nginx   --namespace sony-ingress --set controller.replicaCount=2   --set controller.nodeSelector."beta\.kubernetes\.io/os"=linux   --set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=linux
helm list --namespace sony-ingress
kubectl get all --namespace sony-ingress
kubectl edit svc sony-release-ingress-nginx-controller -n sony-ingress

After executing above command its creating classic load balancer in AWS console, but i want to create application load balancer. cloud you please some one help me on this.

[root@ helm-ingress-install]# kubectl get all --namespace sony-ingress
NAME                                                                READY   STATUS    RESTARTS   AGE
pod/sony-release-ingress-nginx-controller-67c669747b-54c28   1/1     Running   0          2m52s
pod/sony-release-ingress-nginx-controller-67c669747b-ptjmv   1/1     Running   0          2m52s

NAME                                                             TYPE           CLUSTER-IP      EXTERNAL-IP                                                                           PORT(S)                      AGE
service/sony-release-ingress-nginx-controller             LoadBalancer   172.20.62.149   internal-12345halalabalcla-15789654.eu-central-1.elb.amazonaws.com   80:32697/TCP,443:32762/TCP   2m53s
service/sony-release-ingress-nginx-controller-admission   ClusterIP      172.20.23.187   <none>                                                                                443/TCP                      2m53s

NAME                                                           READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/sony-release-ingress-nginx-controller   2/2     2            2           2m53s

NAME                                                                      DESIRED   CURRENT   READY   AGE
replicaset.apps/sony-release-ingress-nginx-controller-67c669747b   2         2         2       2m53s

Upvotes: 2

Views: 2229

Answers (1)

Harsh Manvar
Harsh Manvar

Reputation: 30208

You have to pass the annotation to get the type of load balancers like NLB or ALB

Add this annotation into the service, which you are exposing as the type LoaBalancer.

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
    service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '60'
    service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: 'true'
    service.beta.kubernetes.io/aws-load-balancer-type: alb

here is example : https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/

The above example is for NLB it's using nlb in annotation but you can change it to alb.

Here official alb ingress example : https://aws.amazon.com/blogs/opensource/kubernetes-ingress-aws-alb-ingress-controller/

Upvotes: 2

Related Questions