使用 Google Cloud Container 实施 HTTPS 的步骤是什么?

What are the steps to implement HTTPS with Google Cloud Containers?

找不到任何简单说明这里是您的证书所在位置以及如何启用它的资源。当我 运行 gcloud compute ssl-certificates list 时,我在那里有证书。我有一个带有 kubernetes 运行 的集群,并通过此服务公开 http 流量:

{
  "kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "foo-frontend-service"
  },
  "spec": {
    "selector": {
      "app": "foo-frontend-rc"
    },
    "ports": [
      {
        "protocol": "TCP",
        "port": 80,
        "targetPort": 3009
      }
    ]
  }
}
  1. 需要知道如何将证书放在正确的位置以供使用
  2. 需要知道如何重新配置​​我的服务
  3. 需要知道我的新 SSL 端点是什么。一样吗?

K8s 没有对普通服务的特殊 TLS 支持。您需要使用以下方法之一:

  1. 使用 Ingress:参见 http://kubernetes.io/docs/user-guide/ingress/#tls. You need to choose a Ingress controller which implements the Ingress functionalities, you can use GLBC if you are on GCE, or you can use the nginx one. Both of them supports TLS. Please note that the Ingress is still beta feature with limitations

  2. contrib repo 中的 service-loadbalancer 也支持 tls: https://github.com/kubernetes/contrib/tree/master/service-loadbalancer#ssl-termination