2

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,

Rajesh Thakur
  • 31
  • 1
  • 1
  • 5
  • is it always showing the 'pending state'? – abestrad Jun 17 '20 at 08:03
  • 1
    Try this command..I use this in EKS ```kubectl annotate svc service.beta.kubernetes.io/aws-load-balancer-internal=0.0.0.0/0``` – avinashjha Jun 17 '20 at 10:35
  • how did you install k8s with helm chart? – Arghya Sadhu Jun 17 '20 at 12:09
  • @abestrad Yes it always shows in pending state - checking in further .. thanks Avinash Kumar for the command though – Rajesh Thakur Jun 19 '20 at 05:45
  • @AvinashKumar this describe command shows now that it is ensuring the LB :Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal EnsuringLoadBalancer 2m (x49 over 3h) service-controller Ensuring load balancer After running this command that you suggested .. but still doe snot show up the EXTERNAL IP , where do I capture the exact logs whats going on under the hood here – Rajesh Thakur Jul 02 '20 at 14:52
  • I think it is not getting the subnet and because of which it is not able to connect and get the IP, how do I pass the subnet for ELB ? All the annotations I see are for the ALB – Rajesh Thakur Jul 02 '20 at 15:14

2 Answers2

2

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.
Will R.O.F.
  • 3,814
  • 1
  • 9
  • 19
  • Thanks for the details . somehow issue is still the same and investigating now at the HelmCharts level.. Cant I get the underlying logs / concurrent logs for why it gets in pending state ? like you know , what is it which is stopping it to spin the EXT IP. ? – Rajesh Thakur Jun 19 '20 at 06:03
  • You probably should reach your Cloud Provider Support, since the action of providing the LoadBalancer IP is managed by it. – Will R.O.F. Jun 24 '20 at 16:32
0

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"]}}'
RiveN
  • 2,595
  • 11
  • 13
  • 26
Hack-Z
  • 47
  • 7