【问题标题】:How to force apiserver proxy to use HTTPS in connection to container如何强制 apiserver 代理使用 HTTPS 连接到容器
【发布时间】:2017-01-18 00:12:40
【问题描述】:

我正在尝试通过apiserver proxy 连接到skydns etcd 服务器,使用此文档http://kubernetes.io/docs/user-guide/accessing-the-cluster/#manually-constructing-apiserver-proxy-urls 和命令

curl --cacert /etc/kubernetes/certs/ca.crt --header "授权: 承载 J9bAdaBGyQUEESCz7k412afmpskoHig7" -sS --cert /etc/pki/etcd/etcd-dns.crt --key /etc/pki/etcd/etcd-dns.key https://95.164.68.160:6443/api/v1/proxy/namespaces/2701e09a-b9f7-4b77-b4ad-8438a974ddfe/services/service-f1g5a:2379/v2/keys

但有错误

错误:'dial tcp 10.254.63.2:2379: i/o timeout'

试图联系:'http://10.254.63.2:2379/v2/keys'

它似乎尝试连接到 http 而不是 https

医生说,

目标代理可以使用代理选择的 HTTP 或 HTTPS 可用信息

它使用什么信息?如何强制使用https

【问题讨论】:

    标签: ssl proxy kubernetes


    【解决方案1】:

    您可以在服务名称前加上“https:” 可识别以下格式:

    # Proxies to the first port in the service, using http
    https://<master>/api/v1/namespaces/myns/services/myservice/proxy/...
    
    # Proxies to the specified port in the service, using http
    https://<master>/api/v1/namespaces/myns/services/myservice:myport/proxy/...
    
    # Proxies to the specified port, using https
    https://<master>/api/v1/namespaces/myns/services/https:myservice:myport/proxy/...
    

    【讨论】:

    • 这在文档中吗?我没找到。
    猜你喜欢
    • 1970-01-01
    • 2016-10-21
    • 2021-12-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-02
    • 1970-01-01
    • 2015-12-06
    相关资源
    最近更新 更多