与服务器 localhost:8080 的连接被拒绝 - IBM Private Cloud 2.1.0.2 安装

The connection to the server localhost:8080 was refused - IBM Private Cloud 2.1.0.2 Installation

在安装 IBM Cloud Private 2.1.0.2(单节点集群)期间出现以下错误消息:

TASK [network : Enabling calico] ***********************************************
task path: /installer/playbook/roles/network/tasks/calico.yaml:8
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no 127.0.0.1 '/bin/bash -c '"'"'echo ~ && sleep 0'"'"''
<127.0.0.1> (0, '/home/user\n', '')
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no 127.0.0.1 '/bin/bash -c '"'"'( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494 `" && echo ansible-tmp-1528976337.25-231156419672494="` echo /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494 `" ) && sleep 0'"'"''
<127.0.0.1> (0, 'ansible-tmp-1528976337.25-231156419672494=/home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494\n', '')
<127.0.0.1> PUT /tmp/tmp98uaOG TO /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py
<127.0.0.1> SSH: EXEC sshpass -d10 sftp -o BatchMode=no -b - -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no '[127.0.0.1]'
<127.0.0.1> (0, 'sftp> put /tmp/tmp98uaOG /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py\n', '')
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no 127.0.0.1 '/bin/bash -c '"'"'chmod u+x /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/ /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py && sleep 0'"'"''
<127.0.0.1> (0, '', '')
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: user
<127.0.0.1> SSH: EXEC sshpass -d10 ssh -C -o CheckHostIP=no -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o Port=22 -o 'IdentityFile="cluster/ssh_key"' -o User=user -o ConnectTimeout=10 -oPubkeyAuthentication=no -tt 127.0.0.1 '/bin/bash -c '"'"'sudo -H -S -i -p "[sudo via ansible, key=souadjgrohvvwgbsdjfdverklmfvdouq] password: " -u root /bin/bash -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-souadjgrohvvwgbsdjfdverklmfvdouq; /usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/command.py; rm -rf "/home/user/.ansible/tmp/ansible-tmp-1528976337.25-231156419672494/" > /dev/null 2>&1'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<127.0.0.1> (0, '\r\n\r\n{"changed": true, "end": "2018-06-14 13:38:59.184433", "stdout": "", "cmd": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", "rc": 1, "start": "2018-06-14 13:38:59.060894", "stderr": "The connection to the server localhost:8080 was refused - did you specify the right host or port?", "delta": "0:00:00.123539", "invocation": {"module_args": {"warn": true, "executable": "/bin/bash", "_uses_shell": true, "_raw_params": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", "removes": null, "creates": null, "chdir": null}}, "warnings": []}\r\n', 'Connection to 127.0.0.1 closed.\r\n')
fatal: [127.0.0.1]: FAILED! => {
    "changed": true, 
    "cmd": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", 
    "delta": "0:00:00.123539", 
    "end": "2018-06-14 13:38:59.184433", 
    "failed": true, 
    "invocation": {
        "module_args": {
            "_raw_params": "kubectl apply --force --overwrite=true -f /installer/cluster/cfc-components/calico.yaml", 
            "_uses_shell": true, 
            "chdir": null, 
            "creates": null, 
            "executable": "/bin/bash", 
            "removes": null, 
            "warn": true
        }
    }, 
    "rc": 1, 
    "start": "2018-06-14 13:38:59.060894", 
    "stderr": "The connection to the server localhost:8080 was refused - did you specify the right host or port?", 
    "stderr_lines": [
        "The connection to the server localhost:8080 was refused - did you specify the right host or port?"
    ], 
    "stdout": "", 
    "stdout_lines": []
}

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=204  changed=67   unreachable=0    failed=1   

Playbook run took 0 days, 0 hours, 9 minutes, 36 seconds

user@user:/opt/ibm-cloud-private-ce-2.1.0.2/cluster$ 

我在网上看到了一些关于这个错误的 kubernetes 线程,但我还没有找到适合我的解决方案,因为我没有 /etc/kubernetes 文件夹,也没有任何 admin.conf 文件库伯内特斯。

因为我也只是在单节点集群上安装 ICP,所以它也不应该与将 ~/.kube/config 文件传递​​给其他节点有任何关系。

感谢您的帮助!

我找到了修复方法,可以通过取消注释 config.yaml 中的 "kube_apiserver_insecure_port: 8888" 以及将 "8888" 更改为 "8080" 来解决此错误。