LoadBalancer 'EXTERNAL IP" is in pending state after I installed k8s using helm Charts

Viewed 8009

I Installed K8S with Helm Charts on EKS but the Loadbalancer EXTERNAL IP is in pending state , I see that EKS does support the service Type : LoadBalancer now.

Is it something I will have to check at the network outgoing traffic level ? Please share your experience if any.

Tx,

2 Answers

The Loadbalancer usually takes some seconds or a few minutes to provision you an IP.

If after 5 minutes the IP isn't provisioned: - run kubectl get svc <SVC_NAME> -o yaml and if there is any different annotation set.

  • By default services with Type:LoadBalancer are provisioned with Classic Load Balancers automatically. Learn more here.

  • If you wish to use Network load Balancers you have to use the annotation:

service.beta.kubernetes.io/aws-load-balancer-type: nlb
  • The process is really automatic, you don't have to check for network traffic.

  • You can check if there is any issue with the Helm Chart you are deploying by manually creating a service with loadbalancer type and check if it gets provisioned:

$ kubectl run --generator=run-pod/v1 nginx --image=nginx --port=80
pod/nginx created

$ kubectl get pod nginx
NAME    READY   STATUS    RESTARTS   AGE
nginx   1/1     Running   0          34s

$ kubectl expose pod nginx --type=LoadBalancer
service/nginx exposed

$ kubectl get svc nginx -w
NAME    TYPE           CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE
nginx   LoadBalancer   10.1.63.178   <pending>     80:32522/TCP   7s
nginx   LoadBalancer   10.1.63.178   35.238.146.136   80:32522/TCP   42s
  • In this example the LoadBalancer took 42s to be provisioned. This way you can verify if the issue is on the Helm Chart or something else.

If Kubernetes is running in an environment that doesn't support LoadBalancer services, the load balancer will not be provisioned, but the service will still behave like a NodePort service, your cloud/K8 engine should support LoadBalancer Service.

In that case, if you manage to add EIP or VIP to your node then you can attach to the EXTERNAL-IP of your TYPE=LoadBalancer in the K8 cluster, for example attaching the EIP/VIP address to the node 172.16.2.13.

kubectl patch svc ServiceName -p '{"spec": {"type": "LoadBalancer", "externalIPs":["172.16.2.13"]}}'
Related