HTTP(S) Load Balancing for Kubernetes / Docker

4/18/2016

I am running a restfull service behind self signed cert thru NGINX in google cloud kubernetes infrastructure. Kubernetes service loader exposes 443 and routes the traffic those containers. All is working just fine as expected other than asking internal clients to ignore the self sign cert warning! It is time for to move to CA cert thus only option as far as I see is https loader but I couldnt figure out how we can reroute the traffic to service loader or directly to pods as service loader(http loader)

Any help apprecaited

-- East2West
docker
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

4/19/2016

I'm not sure I fully understand you question but I'll try to answer it anyway.

You have two options for exposing your service using a cert signed by a trusted CA:

  1. Do what you are doing today but with the real cert. You will probably want to put the cert into a secret and point your nginx configuration at it to load the cert.

  2. Replace nginx with the google L7 load balancer. You would upload your certificate to google, configure the L7 balancer to terminate HTTPS and forward traffic to your backends.

-- Robert Bailey
Source: StackOverflow

5/4/2016
  1. Update Firewall Rules for:

    IP: 130.211.0.0/22
    tcp:30000-32767
  2. Create NodePort type service:

    apiVersion: v1
    kind: Service
    metadata:
      name: yourservicenodeport
      labels:
        name: your-service-node-port
    spec:
      type: NodePort
      ports:
        - port: 80
          nodePort: 30001
      selector:
        name: yourpods
  3. Create health check.

    For the nodeport which is in this case: 30001

  4. Create an ingress service:

    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      name: youTheking-ingress-service
    spec:
      backend:
        serviceName: yourservice
        servicePort: 80
  5. Wait for few minutes, be patient.

  6. Change the health check on http load balancer.

    a. Go to the Load Balancing on Networking Tab.

    b. Click Advance menu.

    c. Go Backend Services and Edit.

    d. Update health check option and use the one created for nodeport service.

  7. Repeat step 5 for instance group to be recognized health.

  8. SSL is needed, go back to the load balancer, edit, click Frontend Configuration, then add https with cert.

  9. You are ready to roll.

-- East2West
Source: StackOverflow