相关文章推荐
痴情的铁链  ·  ByteBuffer中flip、mark、r ...·  2 周前    · 
初始化Kubenetes报错2:error execution phase preflight: [preflight] Some fatal errors occurred: [ER
最新推荐文章于 2023-04-29 15:12:21 发布
最新推荐文章于 2023-04-29 15:12:21 发布

报错信息:

error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Port-6443]: Port 6443 is in use
        [ERROR Port-10251]: Port 10251 is in use
        [ERROR Port-10252]: Port 10252 is in use
        [ERROR FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
        [ERROR FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
...

过程回顾:

[root@test2 ~]# kubeadm init --apiserver-advertise-address=192.168.2.129 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.13.3 --service-cidr=10.1.0.0/16 --pod-network-cidr=10.244.0.0/16
[init] Using Kubernetes version: v1.13.3
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Port-6443]: Port 6443 is in use
        [ERROR Port-10251]: Port 10251 is in use
        [ERROR Port-10252]: Port 10252 is in use
        [ERROR FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists
        [ERROR FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml]: /etc/kubernetes/manifests/kube-controller-manager.yaml already exists
        [ERROR FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml]: /etc/kubernetes/manifests/kube-scheduler.yaml already exists
        [ERROR FileAvailable--etc-kubernetes-manifests-etcd.yaml]: /etc/kubernetes/manifests/etcd.yaml already exists
        [ERROR Port-10250]: Port 10250 is in use
        [ERROR Port-2379]: Port 2379 is in use
        [ERROR Port-2380]: Port 2380 is in use
        [ERROR DirAvailable--var-lib-etcd]: /var/lib/etcd is not empty
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...

问题解决:

[root@test2 ~]# kubeadm reset     //重启kubeadm
[reset] WARNING: changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] are you sure you want to proceed? [y/N]: y    //输入y
[preflight] running pre-flight checks
[reset] Reading configuration from the cluster...
[reset] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
W0717 17:33:41.676764   77512 reset.go:213] [reset] Unable to fetch the kubeadm-config ConfigMap, using etcd pod spec as fallback: failed to get config map: configmaps "kubeadm-config" not found
[reset] stopping the kubelet service
[reset] unmounting mounted directories in "/var/lib/kubelet"
[reset] deleting contents of stateful directories: [/var/lib/etcd /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/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually.
For example:
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.
[root@test2 ~]# kubeadm init \
--apiserver-advertise-address=192.168.2.129 \
--image-repository registry.aliyuncs.com/google_containers \
--kubernetes-version v1.13.3 \
--service-cidr=10.1.0.0/16 \
--pod-network-cidr=10.244.0.0/16
......
Your Kubernetes master has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config
You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/
You can now join any number of machines by running the following on each node
as root:
  kubeadm join 192.168.2.129:6443 --token si974n.v8615659h9x6x4xe --discovery-token-ca-cert-hash sha256:d6d1c5d0290ee0217d14d7d6bdea23b1fc911186e0ea94847a1f52d8ed32761d

 重新初始化Kubenetes成功。

↓↓↓↓↓↓

最近刚申请了个微信公众号,上面也会分享一些运维知识,大家点点发财手关注一波,感谢大家。 【原创公众号】:非著名运维 【福利】:公众号回复 “资料” 送运维自学资料大礼包哦!
在这里插入图片描述

kubeadm初始化kubernetes报错error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR FileAvailable–etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exists [ERROR FileAvailable–etc-kuber 前端在调试调用合约的时候经常会遇到合约revert的情况,大部分区块浏览器只会显示 execution reverted,并不会把具体原因告诉我们。这个时候一般会去找合约大哥帮忙分析错误,但是合约大哥是怎么分析报错的呢?这篇文章给你一个解题方法。 [root@k8s-master01 ~]# kubeadm init --config config.yaml [init] Using Kubernetes version: v1.10.0 [init] Using Authorization modes: [Node RBAC] [preflight] Running pre-flight checks. [preflight] Some... 当前最新版本为 v1.13.3 在 18 年 6 月份京东活动的时候,买了一本 Kubernetes 权威指南,一直没时间看,春节期间正好学学。由于书上使用的是 2017 年的 1.6.0 版本,我自己为了使用最新版本,特地做一个记录。 虽然买了本书,但是整个操作过程参考了很多资料,主要是 kubeadm 官方文档: https://k... 运行kubeadm join 命令加入集群时,报如下错 root@zrs:~# kubeadm join 192.168.1.62:6443 --token r6omg1.wf03wzc5a13u7ubi --discovery-token-ca-cert-hash sha256:de0da2432966401f76b217870bc296c5c21b8a059522885c90e7809f5c2d98dd 报错信息 [preflight] Running pre-flight c [init] Using Kubernetes version: v1.14.0 [preflight] Running pre-flight checks error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR Port-6443]: Port 6443 is in use [ERROR Port-10251]: Port 10251 is in use [ERROR Port-10252]: . [root@k8s-master01 ~]# kubeadm init --config=kubeadm-config.yaml --experimental-upload-certs | tee kubeadm-init.log Flag --experimental-upload-certs has been deprecated, use --upload-certs instead [init] Using Kubernetes version:. 报错信息如下: error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR FileContent–proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1 [ERROR FileContent–proc-sys-net-ipv4-ip 我用的是ubuntu16.04,首先要做的是配置apt源,这里推荐阿里云的源地址https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg,centos的在这儿https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64,用梯子的... 参考链接:K8S部署遇到的问题处理汇总node节点加入k8s集群失败kubeadm join 运行出错:FileAvailable--etc-kubernetes-pki-ca.crt,FileAvailable--etc-kubernetes-bootstrap-k 报错查询 error execution phase preflight: [preflight] Some fatal e... k8s 常见报错处理 [WARNING IsDockerSystemdCheck]: detected “cgroupfs” as the Docker cgroup driver. The recommended driver is “systemd”. Please follow the guide at https://kubernetes.io/docs/setup/cri/ error... 更多kubernetes文章:k8s专栏目录安装过程见 离线安装k8s 1.9.0安装资料参考见 k8s安装 1.9版本  官方文档 安装实践 离线安装包 视频 课程k8s 1.5 与 k8s 1.9的差别参照以前安装kubernetes 1.5.2失败,原因是docker包冲突。在查看高版本安装过程中发现,高版本kubernetes不再打包安装docker,而是需要用户先自行安装好docker服...