尝试使用Kubespray部署Kuberntes时发生SSLError:('读取操作超时')

时间:2019-04-28 14:11:49

标签: kubernetes centos7 kvm kubespray cri-o

您好,谢谢您的帮助!

我正在尝试使用Kubespray(一个有趣的剧本)部署Kubernetes集群。我正在尝试在17个KVM主机上部署群集(所有节点都在centos 7上运行,并且都在裸机服务器上托管)

但是,当我尝试在任务[download : file_download | Download item]上运行剧本时 我收到以下错误(并因此停止了安装):

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: SSLError: ('The read operation timed out',)                                                                                                                              
fatal: [node1]: FAILED! => {"attempts": 4, "changed": false, "msg": "failed to create temporary content file: ('The read operation timed out',)"} 

对于大多数节点BUT来说,此错误是相同的,有些节点愿意降级。

这是详细模式下的错误:

The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible_get_url_payload_72qREk/__main__.py", line 360, in url_get
    shutil.copyfileobj(rsp, f)
  File "/usr/lib64/python2.7/shutil.py", line 49, in copyfileobj
    buf = fsrc.read(length)
  File "/usr/lib64/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "/usr/lib64/python2.7/httplib.py", line 602, in read
    s = self.fp.read(amt)
  File "/usr/lib64/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "/usr/lib64/python2.7/ssl.py", line 757, in recv
    return self.read(buflen)
  File "/usr/lib64/python2.7/ssl.py", line 651, in read
    v = self._sslobj.read(len or 1024)
SSLError: ('The read operation timed out',)

fatal: [node14]: FAILED! => {
    "attempts": 4,
    "changed": false,
    "invocation": {
        "module_args": {
            "attributes": null,
            "backup": null,
            "checksum": "",
            "client_cert": null,
            "client_key": null,
            "content": null,
            "delimiter": null,
            "dest": "/tmp/releases/kubeadm",
            "directory_mode": null,
            "follow": false,
            "force": false,
            "force_basic_auth": false,
            "group": null,
            "headers": null,
            "http_agent": "ansible-httpget",
            "mode": "0755",
            "owner": "root",
            "regexp": null,
            "remote_src": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "sha256sum": "c4fc478572b5623857f5d820e1c107ae02049ca02cf2993e512a091a0196957b",
            "src": null,
            "timeout": 10,
            "tmp_dest": null,
            "unsafe_writes": null,
            "url": "https://storage.googleapis.com/kubernetes-release/release/v1.14.1/bin/linux/amd64/kubeadm",
            "url_password": null,
            "url_username": null,
            "use_proxy": true,
            "validate_certs": true
        }
    },
    "msg": "failed to create temporary content file: ('The read operation timed out',)"
}

我尝试连接到节点并尝试下载一个项目(我尝试下载Kubspray zip),并且它可以正常工作,所有节点都可以连接到互联网并可以安装软件包。

从详细的输出中,我有点理解错误来自python,但是我真的不知道如何解决...

请让我知道是否能再给您提供另一条信息并再次感谢您!

1 个答案:

答案 0 :(得分:1)

所以,我“解决了”问题。

实际上,Ansbible对所有ssh相关的命令/读取/写入任务有10秒的超时。 由于未知的原因,我的节点上的写入任务有点慢,所以出现了此错误。 幸运的是,您可以更改超时之前的时间。

您可以使用参数-T(或-tiemout)'time_wanted'或更改ansible.cfg。 “基本” cfg文件位于etc/ansible/ansible.etc中,但请注意,某些自定义ansible剧本将具有自定义ansible.cfg,因此您需要找到它并根据需要进行更改。

我很幸运,我第四次运行剧本时,它顺利安装了K8s。

出于测试的原因,我在KVM上运行我的节点,所以也许写入慢速来自这里。

希望有人会发现我的答案有用!