hemanth_peddi
hemanth_peddi

Reputation: 77

How to create application load balancer to expose kubernetes cluster

As i went through few resources on the internet i managed to create classic load balancer by setting the flags in my kube.apiserver, kubelet.service, kubecontroller manager and created a cluster and deployed a sample nginx file and it has exposed the application but i see that it has created classic load balancer and what i wanted is an application load balancer to be created am i supposed to do anymore changes? and also when i deploy a kibana helm chart i do get an load balancer external ip but when i access it i don't see any page.

NAME                                        READY   STATUS    RESTARTS   AGE
pod/elasticsearch-client-5df74c974d-dp6xw   1/1     Running   0          5h52m
pod/elasticsearch-data-0                    1/1     Running   0          5h52m
pod/elasticsearch-master-0                  1/1     Running   0          5h52m
pod/fluent-bit-h9kgm                        1/1     Running   0          5h52m
pod/kibana-b9d8dc6d5-cbj8j                  1/1     Running   0          7s

NAME                              TYPE           CLUSTER-IP      EXTERNAL-IP                                                              PORT(S)         AGE
service/elasticsearch-client      ClusterIP      10.100.13.46    <none>                                                                   9200/TCP        5h52m
service/elasticsearch-discovery   ClusterIP      None            <none>                                                                   9300/TCP        5h52m
service/kibana                    LoadBalancer   10.100.14.245   adaec083b81644ecbb87d4d2ba0dc070-693460825.us-east-1.elb.amazonaws.com   443:32734/TCP   7s

NAME                        DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/fluent-bit   1         1         1       1            1           <none>          5h52m

NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/elasticsearch-client   1/1     1            1           5h52m
deployment.apps/kibana                 1/1     1            1           7s

NAME                                              DESIRED   CURRENT   READY   AGE
replicaset.apps/elasticsearch-client-5df74c974d   1         1         1       5h52m
replicaset.apps/kibana-b9d8dc6d5                  1         1         1       7s

NAME                                    READY   AGE
statefulset.apps/elasticsearch-data     1/1     5h52m
statefulset.apps/elasticsearch-master   1/1     5h52m

As you can see above i'm able to get a LoadBalancer <externalIP> but i don't see anything when i open that link.

And also my requirement was to deploy an Application Load Balancer and after i would deploy an Ingress helm chart and in the ingress resources i would specify the paths and ports.

Upvotes: 0

Views: 504

Answers (1)

Arghya Sadhu
Arghya Sadhu

Reputation: 44559

From the docs as of now only ELB and NLB is supported loadbalancer type for AWS.

Edit:

Using LoadBalancer type service you can have single NLB/ELB for the nginx ingress controller and use it for as many ingress resource as you want to route traffic to backend cluster IP type service.

But if you wan to use ALB you have to manually create it (following AWS docs) and configure it to forward traffic to your Kubernetes nodes NodePort where nginx ingress controller is running. Creating a LoadBalancer type service will not work in this case. You will have to create a NodePort service for the nginx ingress controller.

Upvotes: 2

Related Questions