使用kubeadm时,kube-discovery无法启动

时间:2016-11-22 16:34:37

标签: kubernetes

我正在尝试使用kubeadm使用this guide安装群集。 我将它安装在裸机Ubuntu 16.04服务器上。

Docker已预先安装:

root@host# docker -v
Docker version 1.12.3, build 6b644ec

执行以下操作后:

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubelet kubeadm kubectl kubernetes-cni

我运行'kubeadm init',它挂在kube-discovery插件上:

root@host# kubeadm init
Running pre-flight checks
<master/tokens> generated token: "<token>"
<master/pki> generated Certificate Authority key and certificate:
Issuer: CN=kubernetes | Subject: CN=kubernetes | CA: true
Not before: 2016-11-22 15:27:25 +0000 UTC Not After: 2026-11-20 15:27:25 +0000 UTC
Public: /etc/kubernetes/pki/ca-pub.pem
Private: /etc/kubernetes/pki/ca-key.pem
Cert: /etc/kubernetes/pki/ca.pem
<master/pki> generated API Server key and certificate:
Issuer: CN=kubernetes | Subject: CN=kube-apiserver | CA: false
Not before: 2016-11-22 15:27:25 +0000 UTC Not After: 2017-11-22 15:27:25 +0000 UTC
Alternate Names: [<ipaddress> kubernetes kubernetes.default kubernetes.default.svc kubernetes.default.svc.cluster.local]
Public: /etc/kubernetes/pki/apiserver-pub.pem
Private: /etc/kubernetes/pki/apiserver-key.pem
Cert: /etc/kubernetes/pki/apiserver.pem
<master/pki> generated Service Account Signing keys:
Public: /etc/kubernetes/pki/sa-pub.pem
Private: /etc/kubernetes/pki/sa-key.pem
<master/pki> created keys and certificates in "/etc/kubernetes/pki"
<util/kubeconfig> created "/etc/kubernetes/kubelet.conf"
<util/kubeconfig> created "/etc/kubernetes/admin.conf"
<master/apiclient> created API client configuration
<master/apiclient> created API client, waiting for the control plane to become ready
<master/apiclient> all control plane components are healthy after 44.584082 seconds
<master/apiclient> waiting for at least one node to register and become ready
<master/apiclient> first node is ready after 1.003104 seconds
<master/apiclient> attempting a test deployment
<master/apiclient> test deployment succeeded
<master/discovery> created essential addon: kube-discovery, waiting for it to become ready

我可以看到这个pod正在重启:

root@host# kubectl get pods --all-namespaces=true
NAMESPACE     NAME                                                               READY     STATUS             RESTARTS   AGE
kube-system   dummy-2088944543-dsjtb                                             1/1       Running            0          29m
kube-system   etcd-host.test.com                      1/1       Running            0          29m
kube-system   kube-apiserver-host.test.com            1/1       Running            0          30m
kube-system   kube-controller-manager-host.test.com   1/1       Running            0          29m
kube-system   kube-discovery-1150918428-ulap3                                    0/1       CrashLoopBackOff   10         29m
kube-system   kube-scheduler-host.test.com            1/1       Running            0          29m

root@host# kubectl logs kube-discovery-1150918428-ulap3 --namespace=kube-system
2016/11/22 13:31:32 root CA certificate does not exist: /tmp/secret/ca.pem

我需要提供证书吗?

1 个答案:

答案 0 :(得分:0)

您尝试安装哪种特定版本的kubernetes?您可以查看:

apt-get policy kubelet