Create a Load Balancer

The Kubernetes Manifest

Kubernetes defines a Service resource with type LoadBalancer,
that you can use to create a managed load balancer in SysEleven Stack.

The following Service will expose ports 80 and 443 of all Pods in the default namespace matching the app: nginx label to the internet through a load balancer:

kind: Service
apiVersion: v1
  name: nginx-ingress
    app: nginx
    - protocol: TCP
      port: 80
      name: http
    - protocol: TCP
      port: 443
      name: https
  type: LoadBalancer

The created LoadBalancer Service might look like this:

$ kubectl get svc
NAME            TYPE           CLUSTER-IP     EXTERNAL-IP      PORT(S)                      AGE
nginx-ingress   LoadBalancer   80:31228/TCP,443:30279/TCP   11s

The load balancer listens on port 80 and 443 and forwards traffic to ports 31228 and 30279 on the nodes respectively.
Traffic coming into these "NodePorts" is then sent to the Pods matching the Service.