kubernetes-sigs / kubespray

Deploy a Production Ready Kubernetes Cluster
Apache License 2.0
15.86k stars 6.41k forks source link

/etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory #2799

Closed IvanBiv closed 6 years ago

IvanBiv commented 6 years ago

I see "Error: open /etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory"

call playbook $ ansible-playbook -i my_inventory/inventory cluster.yml -b -vvv

hosts

k8s-m1.me ansible_host=192.168.88.11 ansible_become=yes
k8s-m2.me ansible_host=192.168.88.12 ansible_become=yes
k8s-m3.me ansible_host=192.168.88.10 ansible_become=yes #bootstrap_os=linux_mint

[kube-master]
#k8s-m1.me
k8s-m2.me
k8s-m3.me

[etcd]
#k8s-m1.me
k8s-m2.me
#k8s-m3.me

[kube-node]
# k8s-s2.me

[kube-ingress]
# node2
# node3

[k8s-cluster:children]
kube-master
kube-node
kube-ingress
...
FAILED - RETRYING: Configure | Check if etcd cluster is healthy (1 retries left).Result was: {
    "attempts": 4, 
    "changed": false, 
    "cmd": "/usr/local/bin/etcdctl --endpoints=https://192.168.88.12:2379 cluster-health | grep -q 'cluster is healthy'", 
    "delta": "0:00:00.021370", 
    "end": "2018-05-18 16:25:54.211548", 
    "failed": true, 
    "invocation": {
        "module_args": {
            "_raw_params": "/usr/local/bin/etcdctl --endpoints=https://192.168.88.12:2379 cluster-health | grep -q 'cluster is healthy'", 
            "_uses_shell": true, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "stdin": null, 
            "warn": true
        }
    }, 
    "msg": "non-zero return code", 
    "rc": 1, 
    "retries": 5, 
    "start": "2018-05-18 16:25:54.190178", 
    "stderr": "Error:  open /etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory", 
    "stderr_lines": [
        "Error:  open /etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory"
    ], 
    "stdout": "", 
    "stdout_lines": []
}
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/commands/command.py
<192.168.88.12> ESTABLISH SSH CONNECTION FOR USER: ansible
<192.168.88.12> SSH: EXEC ssh -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 -o ControlPath=/home/ivan/.ansible/cp/cf6ec25280 192.168.88.12 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ogribkawlrumojuhxsvuqnfqszlyjgih; ETCDCTL_CERT_FILE=/etc/ssl/etcd/ssl/admin-k8s-m2.me.pem ETCDCTL_KEY_FILE=/etc/ssl/etcd/ssl/admin-k8s-m2.me-key.pem /usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<192.168.88.12> (1, '\n{"changed": true, "end": "2018-05-18 16:25:59.382597", "stdout": "", "cmd": "/usr/local/bin/etcdctl --endpoints=https://192.168.88.12:2379 cluster-health | grep -q \'cluster is healthy\'", "failed": true, "delta": "0:00:00.022423", "stderr": "Error:  open /etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory", "rc": 1, "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": true, "_raw_params": "/usr/local/bin/etcdctl --endpoints=https://192.168.88.12:2379 cluster-health | grep -q \'cluster is healthy\'", "removes": null, "creates": null, "chdir": null, "stdin": null}}, "start": "2018-05-18 16:25:59.360174", "msg": "non-zero return code"}\n', '')
fatal: [k8s-m2.me]: FAILED! => {
    "attempts": 4, 
    "changed": false, 
    "cmd": "/usr/local/bin/etcdctl --endpoints=https://192.168.88.12:2379 cluster-health | grep -q 'cluster is healthy'", 
    "delta": "0:00:00.022423", 
    "end": "2018-05-18 16:25:59.382597", 
    "failed": true, 
    "invocation": {
        "module_args": {
            "_raw_params": "/usr/local/bin/etcdctl --endpoints=https://192.168.88.12:2379 cluster-health | grep -q 'cluster is healthy'", 
            "_uses_shell": true, 
            "chdir": null, 
            "creates": null, 
            "executable": null, 
            "removes": null, 
            "stdin": null, 
            "warn": true
        }
    }, 
    "msg": "non-zero return code", 
    "rc": 1, 
    "start": "2018-05-18 16:25:59.360174", 
    "stderr": "Error:  open /etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory", 
    "stderr_lines": [
        "Error:  open /etc/ssl/etcd/ssl/admin-k8s-m2.me.pem: no such file or directory"
    ], 
    "stdout": "", 
    "stdout_lines": []
}

NO MORE HOSTS LEFT ****************************************************************************************************************************************************************************************************************
    to retry, use: --limit @/home/ivan/kubespray/cluster.retry

PLAY RECAP ************************************************************************************************************************************************************************************************************************
k8s-m2.me                  : ok=187  changed=4    unreachable=0    failed=1   
k8s-m3.me                  : ok=151  changed=1    unreachable=0    failed=0   
localhost                  : ok=2    changed=0    unreachable=0    failed=0   

k8s-m2.me:

root@k8s-m2:~# sudo ls /etc/ssl/etcd/ssl/
ca-key.pem  ca.pem  node-k8s-m1.me-key.pem  node-k8s-m1.me.pem  node-k8s-m2.me-key.pem  node-k8s-m2.me.pem  node-k8s-m3.me-key.pem  node-k8s-m3.me.pem

k8s-m3.me:

ivan@k8s-m3 ~/kubespray $ sudo ls /etc/ssl/etcd/ssl/
[sudo] password for ivan: 
admin-k8s-m3.me-key.pem  ca-key.pem  member-k8s-m3.me-key.pem  node-k8s-m1.me-key.pem  node-k8s-m2.me-key.pem  node-k8s-m3.me-key.pem
admin-k8s-m3.me.pem  ca.pem      member-k8s-m3.me.pem      node-k8s-m1.me.pem      node-k8s-m2.me.pem      node-k8s-m3.me.pem
IvanBiv commented 6 years ago

I fix it with add all my nodes in kube-node group (in my_inventory/inventory/hosts) and call: $ ansible-playbook -i my_inventory/inventory remove-node.yml -b -vvv and after again: $ ansible-playbook -i my_inventory/inventory cluster.yml -b -vvv