Creating an internal load balancer

11/2/2015

Currently testing out Kubernetes 1.0.7 on AWS and it creates an external load balancer just fine but I want to know if its possible to create an internal load balancer that is only accessible within the internal subnet.

-- John Smith
amazon-elb
amazon-web-services
kubernetes

3 Answers

6/21/2016

Internal ELBs are supported, at least as of Kubernetes version 1.2.

Per this thread, apply annotation services.beta.kubernetes.io/aws-load-balancer-internal to the service definition.

kind: Service
apiVersion: v1
metadata:
  name: someService
  annotations:
    - name: services.beta.kubernetes.io/aws-load-balancer-internal
      value: 0.0.0.0/0
-- Chris Willmore
Source: StackOverflow

11/6/2015

As Prashanth mentioned no builtin support at the moment but I did the following which works out just fine. Created service type NodePort and manually created the loadbalancer as an internal lb and forwarded traffic to the nodes on the nodeport specified.

-- John Smith
Source: StackOverflow

11/4/2015

Not out of the box (at the time of this writing), but the Kubernetes Ingress api is evolving to support internal loadbalancers. Note the following:

  1. Kubernetes Services are round robin loadbalanced by default.
  2. You can deploy something like the service loadbalancer [1] and access your services on the ClusterIP of the loadbalancer pod, just remove the hostPort line in the rc configuration [2] to avoid exposing them on the public IP of the vm.

[1] https://github.com/kubernetes/contrib/tree/master/service-loadbalancer
[2] https://github.com/kubernetes/contrib/blob/master/service-loadbalancer/rc.yaml#L35

-- Prashanth B
Source: StackOverflow