kairen / kubeadm-ansible

Build a Kubernetes cluster using kubeadm via Ansible.
Apache License 2.0
724 stars 379 forks source link

安装时报错 #46

Closed hbstarjason closed 5 years ago

hbstarjason commented 6 years ago

安装时报如下错误:

k8s-m1: The key's randomart image is:
    k8s-m1: +---[RSA 2048]----+
    k8s-m1: |     o=+*o+*=o.  |
    k8s-m1: |     ..=ooo+oo   |
    k8s-m1: |      o   o.*oo  |
    k8s-m1: |     . . o *.o   |
    k8s-m1: |      = S *      |
    k8s-m1: |     o o O o     |
    k8s-m1: |        E ...    |
    k8s-m1: |         o +=    |
    k8s-m1: |          ==..   |
    k8s-m1: +----[SHA256]-----+
    k8s-m1: Warning: Permanently added '192.16.35.10' (ECDSA) to the list of known hosts.
    k8s-m1: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
hbstarjason commented 6 years ago

有人遇到吗?

The above error message is installed,Has anyone met?

n0madic commented 5 years ago

This is a problem with ansible/ssh, not this playbook. Check yor private key, ssh username etc

hbstarjason commented 5 years ago

Encountered when executing this project code。

cdrage commented 5 years ago

@hbstarjason you need to SSH into your machines first or run the command with: ANSIBLE_HOST_KEY_CHECKING=False

For example:

ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook site.yaml -i hosts.ini
hbstarjason commented 5 years ago

@cdrage There are the following attempts: 1、If the operating system is bento/ubuntu-16.04,no problem with your order . 2、If the operating system is bento/centos-7.2,the problem remains.

cdrage commented 5 years ago

Yeah, unfortunately this is an issue with your SSH configuration. I'm going to close this for now! If you can post the logs that'd be great, but you need to make sure you can SSH into your systems first :+1:

hbstarjason commented 5 years ago
### ignore above 

 k8s-m1: Processing triggers for libc-bin (2.23-0ubuntu10) ...
    k8s-m1: Generating public/private rsa key pair.
    k8s-m1: Enter file in which to save the key (/root/.ssh/id_rsa):
    k8s-m1: Created directory '/root/.ssh'.
    k8s-m1: Your identification has been saved in /root/.ssh/id_rsa.
    k8s-m1: Your public key has been saved in /root/.ssh/id_rsa.pub.
    k8s-m1: The key fingerprint is:
    k8s-m1: SHA256:cVLSm2s5v4oOUYOaPd5JMViqcJoHjwNeydaX7F4+crU root@k8s-m1
    k8s-m1: The key's randomart image is:
    k8s-m1: +---[RSA 2048]----+
    k8s-m1: |        o..      |
    k8s-m1: |  . o .=.o.      |
    k8s-m1: |. o=..++B .o     |
    k8s-m1: |..oO =o. Bo      |
    k8s-m1: | .= * +.S. +     |
    k8s-m1: |   o ..=o.* .    |
    k8s-m1: |      ooo= E     |
    k8s-m1: |       .o.. .    |
    k8s-m1: |       .o ....   |
    k8s-m1: +----[SHA256]-----+
    k8s-m1: Warning: Permanently added '192.16.35.10' (ECDSA) to the list of known hosts.
    k8s-m1: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb/n2kizbM3VwTFZ4pU5seXgZpkOz0wyRfrKT4qpnqxpCMccCSfk34aotQKPXfCEANWd2+sGaXf1Ulk91+TrzvrTXEsuu+ryl708L/ktIV36qwR7bL9oh4NGqbd411pC9Mu7xy9BuTtMTrDEGSjVv6Rd89MlD1Ur/pfguykR6wL4ZBn1O0zouvF6IUdvTDpy4FqbcN/XyV8SPaZZR7WOORuXA5wIPXUp9ueWJjjKk93kdu0fJF32qPODqthNPc2fPe57bt2V/7vmw19Rl1JwD//iS5Gejh5xDHu+90a/pnaHXhLQSola2gOUEs/OntNL2OjPyvbE+GfI20G9dKOoE/ root@k8s-m1
    k8s-m1: Warning: Permanently added '192.16.35.11' (ECDSA) to the list of known hosts.
    k8s-m1: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb/n2kizbM3VwTFZ4pU5seXgZpkOz0wyRfrKT4qpnqxpCMccCSfk34aotQKPXfCEANWd2+sGaXf1Ulk91+TrzvrTXEsuu+ryl708L/ktIV36qwR7bL9oh4NGqbd411pC9Mu7xy9BuTtMTrDEGSjVv6Rd89MlD1Ur/pfguykR6wL4ZBn1O0zouvF6IUdvTDpy4FqbcN/XyV8SPaZZR7WOORuXA5wIPXUp9ueWJjjKk93kdu0fJF32qPODqthNPc2fPe57bt2V/7vmw19Rl1JwD//iS5Gejh5xDHu+90a/pnaHXhLQSola2gOUEs/OntNL2OjPyvbE+GfI20G9dKOoE/ root@k8s-m1
    k8s-m1: Warning: Permanently added '192.16.35.12' (ECDSA) to the list of known hosts.
    k8s-m1: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCb/n2kizbM3VwTFZ4pU5seXgZpkOz0wyRfrKT4qpnqxpCMccCSfk34aotQKPXfCEANWd2+sGaXf1Ulk91+TrzvrTXEsuu+ryl708L/ktIV36qwR7bL9oh4NGqbd411pC9Mu7xy9BuTtMTrDEGSjVv6Rd89MlD1Ur/pfguykR6wL4ZBn1O0zouvF6IUdvTDpy4FqbcN/XyV8SPaZZR7WOORuXA5wIPXUp9ueWJjjKk93kdu0fJF32qPODqthNPc2fPe57bt2V/7vmw19Rl1JwD//iS5Gejh5xDHu+90a/pnaHXhLQSola2gOUEs/OntNL2OjPyvbE+GfI20G9dKOoE/ root@k8s-m1
    k8s-m1:  [WARNING] Ansible is being run in a world writable directory (/vagrant), ignoring it as an ansible.cfg source. For more information see https://docs.ansible.com/ansible/devel/reference_appendices/config.html#cfg-in-world-writable-dir
    k8s-m1:  [WARNING]: provided hosts list is empty, only localhost is available. Note
    k8s-m1: that the implicit localhost does not match 'all'
    k8s-m1:  [WARNING]: Could not match supplied host pattern, ignoring: kube-cluster
    k8s-m1:
    k8s-m1: PLAY [kube-cluster] ************************************************************
    k8s-m1: skipping: no hosts matched
    k8s-m1:  [WARNING]: Could not match supplied host pattern, ignoring: master
    k8s-m1:
    k8s-m1: PLAY [master] ******************************************************************
    k8s-m1: skipping: no hosts matched
    k8s-m1:  [WARNING]: Could not match supplied host pattern, ignoring: node
    k8s-m1:
    k8s-m1: PLAY [node] ********************************************************************
    k8s-m1: skipping: no hosts matched
    k8s-m1:
    k8s-m1: PLAY RECAP *********************************************************************

E:\kubeadm-ansible>
hbstarjason commented 5 years ago

@cdrage Tested,Not related to ANSIBLE_HOST_KEY_CHECKING=False。 The problem lies in:sudo sshpass -p "vagrant" ssh -o StrictHostKeyChecking=no vagrant@${host} "sudo mkdir -p /root/.ssh"