Enable HTTPS on GCE/GKE

有些话、适合烂在心里 提交于 2019-12-03 01:56:10

Since you have not mentioned this already, I'm just assuming you're using Google Container Engine (GKE) for your Kubernetes setup.

In the service resource manifest, if you set the Type to LoadBalancer, Kubernetes on GKE automatically sets up Network load balancing (L4 Load balancer) using GCE. You will have to terminate connections in your pod using your own custom server or something like nginx/apache.

If your goal is to set up a (HTTP/HTTPS) L7 load balancer (which looks to be the case), it will be simpler and easier to use the Ingress resource in Kubernetes (starting with v1.1). GKE automatically sets up a GCE HTTP/HTTPS L7 load balancing with this setup.

You will be able to add your TLS certificates which will get provisioned on the GCE load balancer automatically by GKE.

This setup has the following advantages:

  1. Specify services per URL path and port (it uses URL Maps from GCE to configure this).
  2. Set up and terminate SSL/TLS on the GCE load balancer (it uses Target proxies from GCE to configure this).
  3. GKE will automatically also configure the GCE health checks for your services.

Your responsibility will be to handle the backend service logic to handle requests in your pods.

More info available on the GKE page about setting up HTTP load balancing.

Remember that when using GKE, it automatically uses the available GCE load balancer support for both the use cases described above and you will not need to manually set up GCE load balancing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!