I am running my (kops) kube cluster on AWS. The cluster is in the private subnet. I am not able to create an external (internet facing) load balancer because my cluster is in private space. Is there any way that I can create an internet facing load balancer with my cluster sitting in the private space, if that is not a possible solution how do I expose my service running inside my kube to the outside world?

I am creating with the below annotation for my service

    kind: Service
    name: helloweb

If I don't use "-internal" in the annotation the service goes to pending state

     Normal   EnsuringLoadBalancer        9s (x3 over 24s)  service- 
     controller  Ensuring load balancer
     Warning  CreatingLoadBalancerFailed  8s (x3 over 24s)  service- 
     controller  Error creating load balancer (will retry): failed to 
     ensure load balancer for service default/helloweb: could not find 
     any suitable subnets for creating the ELB

I have also tried ingress, even ingress is not able to create an external elb. Here's my ingress defenition...

    kind: Service
    apiVersion: v1
    name: ingress-nginx
    namespace: ingress-nginx
    app.kubernetes.io/name: ingress-nginx
    app.kubernetes.io/part-of: ingress-nginx

    kubectl get ing
    NAME        HOSTS                 ADDRESS   PORTS AGE                                         
    ingress-rules exampleapp1.kubexpress.cloud,exampleapp2.kubexpress.cloud   internal- 
      l0adbalancer.eu-central-1.elb.amazonaws.com   80        10d
  • Amazon load balancers (public facing) support instances in private subnets. Are your VPC and subnets configured correctly? – John Hanley Oct 4 '18 at 5:49
  • Yes, they are configured correctly. – sumanth Oct 5 '18 at 19:49
  • I think theya re configured properly, are there any specific things you want me to check? – sumanth Oct 8 '18 at 5:58

The problem was in my Kops configurtion. I corrected it by creating utility subnet for each private subnet where my kube master/worker nodes will be at.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.