我正在尝试部署具有4个节点的可安可的kubespray:
jumphost,控制器,compute1,compute2节点。执行部署命令时: ansible-playbook -i目录/ws/hosts.ini --become --become-user = root cluster.yml
我收到了kube-apiserver连接被拒绝的错误。最后,我还附加了hosts.ini
TASK [kubernetes-apps/cluster_roles : Kubernetes Apps | Wait for kube-apiserver]
Monday 18 February 2019 11:38:58 +0000 (0:00:00.173) 0:06:23.303 *******
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (10 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (9 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (8 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (7 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (6 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (5 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (4 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (3 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (2 retries left).
FAILED - RETRYING: Kubernetes Apps | Wait for kube-apiserver (1 retries left).
fatal: [khaled-controller-kolla]: FAILED! => {"attempts": 10, "changed": false, "content": "", "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "https://127.0.0.1:6443/healthz"}
NO MORE HOSTS LEFT *****************************************************************************************************************************************************************************************
to retry, use: --limit @/home/ubuntu/infra-workshop/kubernetes/kubespray/cluster.retry
PLAY RECAP *************************************************************************************************************************************************************************************************
khaled-compute1-kolla : ok=201 changed=0 unreachable=0 failed=0
khaled-compute2-kolla : ok=201 changed=0 unreachable=0 failed=0
khaled-controller-kolla : ok=269 changed=4 unreachable=0 failed=1
localhost : ok=2 changed=0 unreachable=0 failed=0
Monday 18 February 2019 11:40:02 +0000 (0:01:04.412) 0:07:27.715 *******
===============================================================================
kubernetes-apps/cluster_roles : Kubernetes Apps | Wait for kube-apiserver -------------------------------------------------------------------------------------------------------------------------- 64.41s
download : Download items --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7.75s
gather facts from all instances --------------------------------------------------------------------------------------------------------------------------------------------------------------------- 7.43s
kubernetes/master : Install kubectl bash completion ------------------------------------------------------------------------------------------------------------------------------------------------- 5.00s
download : file_download | Download item ------------------------------------------------------------------------------------------------------------------------------------------------------------ 3.36s
etcd : Install | Copy etcdctl binary from docker container ------------------------------------------------------------------------------------------------------------------------------------------ 3.31s
docker : ensure docker packages are installed ------------------------------------------------------------------------------------------------------------------------------------------------------- 3.11s
kubernetes/node : write the kubecfg (auth) file for kubelet ----------------------------------------------------------------------------------------------------------------------------------------- 2.92s
kubernetes/preinstall : Hosts | populate inventory into hosts file ---------------------------------------------------------------------------------------------------------------------------------- 2.55s
docker : Ensure old versions of Docker are not installed. | Debian ---------------------------------------------------------------------------------------------------------------------------------- 2.53s
download : Sync container --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2.23s
kubernetes/secrets : Check_certs | Set 'sync_certs' to true on masters ------------------------------------------------------------------------------------------------------------------------------ 1.98s
kubernetes/preinstall : Create kubernetes directories ----------------------------------------------------------------------------------------------------------------------------------------------- 1.86s
download : container_download | Make download decision if pull is required by tag or sha256 --------------------------------------------------------------------------------------------------------- 1.79s
kubernetes/preinstall : Install packages requirements ----------------------------------------------------------------------------------------------------------------------------------------------- 1.79s
download : container_download | Make download decision if pull is required by tag or sha256 --------------------------------------------------------------------------------------------------------- 1.78s
kubernetes/master : Write kube-apiserver manifest --------------------------------------------------------------------------------------------------------------------------------------------------- 1.74s
download : Download items --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.72s
download : Sync container --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1.69s
download : container_download | Make download decision if pull is required by tag or sha256 --------------------------------------------------------------------------------------------------------- 1.69s
Hosts.ini
[k8s-cluster:children]
kube-master
kube-node
[all]
khaled-controller-kolla ansible_host=10.1.0.36 ansible_user=ubuntu ansible_become=true ip=10.1.0.36
khaled-compute1-kolla ansible_host=10.1.0.37 ansible_user=ubuntu ansible_become=true ip=10.1.0.37
khaled-compute2-kolla ansible_host=10.1.0.38 ansible_user=ubuntu ansible_become=true ip=10.1.0.38
[kube-master]
khaled-controller-kolla
[kube-node]
khaled-controller-kolla
khaled-compute1-kolla
khaled-compute2-kolla
[etcd]
khaled-controller-kolla
[calico-rr]
[vault]
khaled-controller-kolla