安装kubeadm-ansible时,执行Initialize first master出错

  • Choerodon平台版本: 0.6.0

  • 遇到问题的执行步骤:
    ansible-playbook -i inventory/hosts -e @inventory/vars cluster.yml

  • 文档地址:
    http://choerodon.io/zh/docs/installation-configuration/steps/kubernetes/

  • 环境信息(如:节点信息):
    青浦服务器 剩余18G内存,iptables已经关闭

  • 报错日志:

    TASK [master : kubeadm | Initialize first master] ********************************************************************************************************************************************************************
    Wednesday 25 September 2019 15:22:43 +0800 (0:00:01.427) 0:02:45.155 ***
    fatal: [node1]: FAILED! => {“changed”: true, “cmd”: [“kubeadm”, “init”, “–config=/etc/kubernetes/kubeadm-config.yaml”, “–ignore-preflight-errors=all”], “delta”: “0:30:05.311306”, “end”: “2019-09-25 15:52:48.911584”, “failed_when_result”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-09-25 15:22:43.600278”, “stderr”: “\t[WARNING SystemVerification]: docker version is greater than the most recently validated version. Docker version: 18.03.1-ce. Max validated version: 17.03\nFlag --admission-control has been deprecated, Use --enable-admission-plugins or --disable-admission-plugins instead. Will be removed in a future version.\nFlag --insecure-bind-address has been deprecated, This flag will be removed in a future version.\nFlag --insecure-port has been deprecated, This flag will be removed in a future version.\ncouldn’t initialize a Kubernetes cluster”, “stderr_lines”: ["\t[WARNING SystemVerification]: docker version is greater than the most recently validated version. Docker version: 18.03.1-ce. Max validated version: 17.03", “Flag --admission-control has been deprecated, Use --enable-admission-plugins or --disable-admission-plugins instead. Will be removed in a future version.”, “Flag --insecure-bind-address has been deprecated, This flag will be removed in a future version.”, “Flag --insecure-port has been deprecated, This flag will be removed in a future version.”, “couldn’t initialize a Kubernetes cluster”], “stdout”: “[init] Using Kubernetes version: v1.10.12\n[init] Using Authorization modes: [Node RBAC]\n[preflight] Running pre-flight checks.\n[certificates] Using the existing ca certificate and key.\n[certificates] Using the existing apiserver certificate and key.\n[certificates] Using the existing apiserver-kubelet-client certificate and key.\n[certificates] Using the existing sa key.\n[certificates] Using the existing front-proxy-ca certificate and key.\n[certificates] Using the existing front-proxy-client certificate and key.\n[certificates] Valid certificates and keys now exist in “/etc/kubernetes/pki”\n[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/admin.conf”\n[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/kubelet.conf”\n[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/controller-manager.conf”\n[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/scheduler.conf”\n[controlplane] Wrote Static Pod manifest for component kube-apiserver to “/etc/kubernetes/manifests/kube-apiserver.yaml”\n[controlplane] Wrote Static Pod manifest for component kube-controller-manager to “/etc/kubernetes/manifests/kube-controller-manager.yaml”\n[controlplane] Wrote Static Pod manifest for component kube-scheduler to “/etc/kubernetes/manifests/kube-scheduler.yaml”\n[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory “/etc/kubernetes/manifests”.\n[init] This might take a minute or longer if the control plane images have to be pulled.\n\nUnfortunately, an error has occurred:\n\ttimed out waiting for the condition\n\nThis error is likely caused by:\n\t- The kubelet is not running\n\t- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)\n\t- Either there is no internet connection, or imagePullPolicy is set to “Never”,\n\t so the kubelet cannot pull or find the following control plane images:\n\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kube-apiserver-amd64:v1.10.12\n\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kube-controller-manager-amd64:v1.10.12\n\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kube-scheduler-amd64:v1.10.12\n\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/etcd-amd64:3.1.12 (only if no external etcd endpoints are configured)\n\nIf you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:\n\t- ‘systemctl status kubelet’\n\t- ‘journalctl -xeu kubelet’”, “stdout_lines”: ["[init] Using Kubernetes version: v1.10.12", “[init] Using Authorization modes: [Node RBAC]”, “[preflight] Running pre-flight checks.”, “[certificates] Using the existing ca certificate and key.”, “[certificates] Using the existing apiserver certificate and key.”, “[certificates] Using the existing apiserver-kubelet-client certificate and key.”, “[certificates] Using the existing sa key.”, “[certificates] Using the existing front-proxy-ca certificate and key.”, “[certificates] Using the existing front-proxy-client certificate and key.”, “[certificates] Valid certificates and keys now exist in “/etc/kubernetes/pki””, “[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/admin.conf””, “[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/kubelet.conf””, “[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/controller-manager.conf””, “[kubeconfig] Wrote KubeConfig file to disk: “/etc/kubernetes/scheduler.conf””, “[controlplane] Wrote Static Pod manifest for component kube-apiserver to “/etc/kubernetes/manifests/kube-apiserver.yaml””, “[controlplane] Wrote Static Pod manifest for component kube-controller-manager to “/etc/kubernetes/manifests/kube-controller-manager.yaml””, “[controlplane] Wrote Static Pod manifest for component kube-scheduler to “/etc/kubernetes/manifests/kube-scheduler.yaml””, “[init] Waiting for the kubelet to boot up the control plane as Static Pods from directory “/etc/kubernetes/manifests”.”, “[init] This might take a minute or longer if the control plane images have to be pulled.”, “”, “Unfortunately, an error has occurred:”, “\ttimed out waiting for the condition”, “”, “This error is likely caused by:”, “\t- The kubelet is not running”, “\t- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)”, “\t- Either there is no internet connection, or imagePullPolicy is set to “Never”,”, “\t so the kubelet cannot pull or find the following control plane images:”, “\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kube-apiserver-amd64:v1.10.12”, “\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kube-controller-manager-amd64:v1.10.12”, “\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/kube-scheduler-amd64:v1.10.12”, “\t\t- registry.cn-hangzhou.aliyuncs.com/choerodon-tools/etcd-amd64:3.1.12 (only if no external etcd endpoints are configured)”, “”, “If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:”, “\t- ‘systemctl status kubelet’”, “\t- ‘journalctl -xeu kubelet’”]}

  • 原因分析:

    提出您分析问题的过程,以便我们能更准确的找到问题所在

  • 疑问:

    提出您对于遇到和解决该问题时的疑问

您好,重新安装以后,还是会卡在Initialize first master 这一步,大约半小时后,还是会报这个错,是我哪里没配置对吗?iptables已经关闭了。

你在搭建集群前有手动在服务器上安装过docker吗

安装过,需要卸载了吗?

是的,需要卸载,建议执行 ansible-playbook -i inventory/hosts reset.yml然后重新安装。