我用的的Ubuntu18.04,也试过用Ubuntu16.04和centos7,都是一样的错误信息,我执行的代码如下: from kubernetes import client, config, watch
# Configs can be set in Configuration class directly or using helper utility config.load_kube_config(config_file="kubeconfig.yaml") v1 = client.CoreV1Api() print("Listing All services with their info:\n") ret = v1.list_service_for_all_namespaces(watch=False) for i in ret.items: print( "%s \t%s \t%s \t%s \t%s \n" % (i.kind, i.metadata.namespace, i.metadata.name, i.spec.cluster_ip, i.spec.ports))
引用来自“背影轮廓”的评论
kubectl version得到的信息如下:Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.3-30+7770c66690383c-dirty", GitCommit:"7770c66690383c32a840942da3be35b95f5c42ca", GitTreeState:"dirty", BuildDate:"2018-08-30T04:09:28Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
但是用python访问的时候,报OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]错误
引用来自“openthings”的评论
你的Server节点版本是中间版本,有可能存在bug。尝试升级到1.11.2与kubectl的版本一致,试一下看。引用来自“背影轮廓”的评论
好的 我试试引用来自“背影轮廓”的评论
kubectl version得到的信息如下:Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.3-30+7770c66690383c-dirty", GitCommit:"7770c66690383c32a840942da3be35b95f5c42ca", GitTreeState:"dirty", BuildDate:"2018-08-30T04:09:28Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
但是用python访问的时候,报OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]错误
引用来自“openthings”的评论
你的Server节点版本是中间版本,有可能存在bug。尝试升级到1.11.2与kubectl的版本一致,试一下看。引用来自“背影轮廓”的评论
kubectl version得到的信息如下:Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.3-30+7770c66690383c-dirty", GitCommit:"7770c66690383c32a840942da3be35b95f5c42ca", GitTreeState:"dirty", BuildDate:"2018-08-30T04:09:28Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
但是用python访问的时候,报OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]错误
引用来自“背影轮廓”的评论
kubectl version得到的信息如下:Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.3-30+7770c66690383c-dirty", GitCommit:"7770c66690383c32a840942da3be35b95f5c42ca", GitTreeState:"dirty", BuildDate:"2018-08-30T04:09:28Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
但是用python访问的时候,报OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]错误
from kubernetes import client, config, watch
# Configs can be set in Configuration class directly or using helper utility
config.load_kube_config(config_file="kubeconfig.yaml")
v1 = client.CoreV1Api()
print("Listing All services with their info:\n")
ret = v1.list_service_for_all_namespaces(watch=False)
for i in ret.items:
print(
"%s \t%s \t%s \t%s \t%s \n" % (i.kind, i.metadata.namespace, i.metadata.name, i.spec.cluster_ip, i.spec.ports))
Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.3-30+7770c66690383c-dirty", GitCommit:"7770c66690383c32a840942da3be35b95f5c42ca", GitTreeState:"dirty", BuildDate:"2018-08-30T04:09:28Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
但是用python访问的时候,报OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]错误