kubekit icon indicating copy to clipboard operation
kubekit copied to clipboard

安装报错了

Open cncarefree opened this issue 8 years ago • 8 comments

Start to initialize Kubernetes master node...

(1/6) Start to load images for Kubernetes master... (2/6) Start to install components for Kubernetes master... (3/6) Start to configure firewall... (4/6) Start to initialize Kubernetes master... Exit Status: 2

✖ Failed to initialize Kubernetes master node...

cncarefree avatar Nov 17 '17 08:11 cncarefree

install.log

Running transaction test Transaction test succeeded Running transaction 正在安装 : socat-1.7.3.2-2.el7.x86_64 1/5 正在安装 : kubernetes-cni-0.5.1-1.x86_64 2/5 正在安装 : kubelet-1.8.1-0.x86_64 3/5 正在安装 : kubectl-1.8.1-0.x86_64 4/5 正在安装 : kubeadm-1.8.1-0.x86_64 5/5 验证中 : kubectl-1.8.1-0.x86_64 1/5 验证中 : kubelet-1.8.1-0.x86_64 2/5 验证中 : socat-1.7.3.2-2.el7.x86_64 3/5 验证中 : kubernetes-cni-0.5.1-1.x86_64 4/5 验证中 : kubeadm-1.8.1-0.x86_64 5/5

已安装: kubeadm.x86_64 0:1.8.1-0 kubectl.x86_64 0:1.8.1-0 kubelet.x86_64 0:1.8.1-0 kubernetes-cni.x86_64 0:0.5.1-1 socat.x86_64 0:1.7.3.2-2.el7

完毕! KUBEKIT_OUTPUT (3/6) Start to configure firewall... KUBEKIT_OUTPUT (4/6) Start to initialize Kubernetes master... [kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters. [init] Using Kubernetes version: v1.8.3 [init] Using Authorization modes: [Node RBAC] [preflight] Running pre-flight checks

cncarefree avatar Nov 17 '17 09:11 cncarefree

暂时未能重现

TimothyYe avatar Dec 08 '17 07:12 TimothyYe

我也遇到了这个问题。没法启动master

Start to initialize Kubernetes master node...

(1/6) Start to load images for Kubernetes master... (2/6) Start to install components for Kubernetes master... (3/6) Start to configure firewall... (4/6) Start to initialize Kubernetes master... Exit Status: 2

✖ Failed to initialize Kubernetes master node...

运行 journalctl -xe 发现有下面的错误输出

Dec 12 13:50:17 centos-master kubelet[6093]: I1212 13:50:17.676233 6093 controller.go:118] kubelet config controller: validating combination of defaults and flags Dec 12 13:50:17 centos-master kubelet[6093]: error: unable to load client CA file /etc/kubernetes/pki/ca.crt: open /etc/kubernetes/pki/ca.crt: no such file or directory Dec 12 13:50:17 centos-master systemd[1]: kubelet.service: main process exited, code=exited, status=1/FAILURE Dec 12 13:50:17 centos-master systemd[1]: Unit kubelet.service entered failed state. Dec 12 13:50:17 centos-master systemd[1]: kubelet.service failed.

清空一下再试试看

[root@centos-master kubekit]# kubeadm reset [preflight] Running pre-flight checks [reset] Stopping the kubelet service [reset] Unmounting mounted directories in "/var/lib/kubelet" [reset] Removing kubernetes-managed containers [reset] No etcd manifest found in "/etc/kubernetes/manifests/etcd.yaml", assuming external etcd. [reset] Deleting contents of stateful directories: [/var/lib/kubelet /etc/cni/net.d /var/lib/dockershim /var/run/kubernetes] [reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki] [reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]

奇怪的是为什么没有创建 /etc/kubernetes 这个文件件

levonchen avatar Dec 12 '17 05:12 levonchen

重新清空了一下,再安装,dashboard起来了。非常感谢

levonchen avatar Dec 12 '17 06:12 levonchen

@levonchen kubeadm reset 可以清空K8S的组件

TimothyYe avatar Dec 12 '17 06:12 TimothyYe

kubekit 是不是默认就把dns安装,配置好了? 但是我用busybox 试了一下,好像不起作用。 [root@centos-master kub]# kubectl get pods NAME READY STATUS RESTARTS AGE busybox 1/1 Running 0 2m [root@centos-master kub]# kubectl exec -it busybox -- nslookup kubernetes.default Server: 10.96.0.10 Address 1: 10.96.0.10

nslookup: can't resolve 'kubernetes.default' command terminated with exit code 1

希望给点参考意见,还是我需要做额外的单独配置dns吗?

[root@centos-master kub]# kubectl get pods --namespace=kube-system NAME READY STATUS RESTARTS AGE etcd-centos-master 1/1 Running 0 1h kube-apiserver-centos-master 1/1 Running 0 1h kube-controller-manager-centos-master 1/1 Running 0 1h kube-dns-545bc4bfd4-grftq 3/3 Running 0 1h kube-flannel-ds-fqcnc 2/2 Running 1 47m kube-flannel-ds-k8kd4 2/2 Running 1 47m kube-flannel-ds-pbwsl 2/2 Running 1 1h kube-proxy-jpxk8 1/1 Running 0 47m kube-proxy-kxsx4 1/1 Running 0 1h kube-proxy-vllgq 1/1 Running 0 47m kube-scheduler-centos-master 1/1 Running 0 1h kubernetes-dashboard-759ccc86d9-9w7hz 1/1 Running 0 1h

从输出看, dns应该是好的。

levonchen avatar Dec 12 '17 07:12 levonchen

k8s用kube-dns来解决服务发现的问题,service创建的时候,会把service名字注册到kube-dns中。 http://blog.tenxcloud.com/?p=1726

或者你先创建一个pod和service,然后再试试?

TimothyYe avatar Dec 12 '17 14:12 TimothyYe

我也遇到这个问题,原因是我的hostname有下滑下(k8s_master),改成k8s-master之后果断好了

rhettpang avatar Aug 02 '18 14:08 rhettpang