本文介绍了容器引擎kubernetes和ssl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用HTTPS负载平衡在Google云容器引擎上的HTTPS上拥有一个Web应用程序?我创建了SslCertificate资源.而且,我创建了一个kubernetes服务,该服务从外部打开了端口443:

How do I have a web app on HTTPS on google cloud container engine using HTTPS load balancing? I created SslCertificate resource. And, I created a kubernetes service that has port 443 externally open:

{
    "kind":"Service",
    "apiVersion":"v1",
    "metadata":{
        "name":"app",
        "labels":{
            "app":"app"
        }
    },
    "spec":{
        "ports": [
            {
                "port":443,
                "name":"app-server"
            }
        ],
        "selector":{
            "app":"app"
        },
        "type": "LoadBalancer"
    }
}

,但这还不够,对吧?

推荐答案

当您使用"LoadBalancer"指令在Google的云上创建外部化的服务时,它会创建一个 L3负载均衡器.您还可以使用新的Ingress指令创建 L7(例如HTTP)平衡器,但这还不支持SSL.

When you create a service externalized on Google's cloud with the "LoadBalancer" directive, it creates an L3 load balancer. You can also use the new ingress directive to create an L7 (e.g. HTTP) balancer, but that doesn't yet support SSL.

要启用SSL,您应遵循 HTTP负载平衡说明,但在配置云负载均衡器时创建HTTPS服务(带有SSL证书).

To enable SSL, you should follow the HTTP Load Balancing instructions but create an HTTPS service (with an SSL certificate) when configuring the cloud load balancer.

这篇关于容器引擎kubernetes和ssl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-01 13:35