首页 > 其他分享 >kubeadm init失败后

kubeadm init失败后

时间:2023-01-09 12:56:09浏览次数:31  
标签:master1 kubernetes -- etc init 失败 kubeadm kube root

  在使用Kubeadm init主节点时未能成功,并输出了如下的错误信息:

[root@master1 ~]# kubeadm init --config=/etc/kubeadm/init.default.yaml 
[init] Using Kubernetes version: v1.23.15
[preflight] Running pre-flight checks
        [WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
...省略部分信息...
[upload-config] Storing the configuration used in ConfigMap "kubeadm-config" in the "kube-system" Namespace
[kubelet] Creating a ConfigMap "kubelet-config-1.23" in namespace kube-system with the configuration for the kubelets in the cluster
NOTE: The "kubelet-config-1.23" naming of the kubelet ConfigMap is deprecated. Once the UnversionedKubeletConfigMap feature gate graduates to Beta the default name will become just "kubelet-config". Kubeadm upgrade will handle this transition transparently.
[kubelet-check] Initial timeout of 40s passed.
error execution phase upload-config/kubelet: Error writing Crisocket information for the control-plane node: nodes "master1.localk8s" not found
To see the stack trace of this error execute with --v=5 or higher

  可以确定的是主机的/etc/hosts文件中正确配置了master1.localk8s,按以下命令一条一条执行后,重新初始化才成功:

[root@master1 ~]# kubeadm reset
[root@master1 ~]# systemctl daemon-reload
[root@master1 ~]# systemctl restart kubelet
[root@master1 ~]# iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
[root@master1 ~]# kubeadm init --config=/etc/kubeadm/init.default.yaml
[init] Using Kubernetes version: v1.23.15
[preflight] Running pre-flight checks
        [WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Port-6443]: Port 6443 is in use
        [ERROR Port-10259]: Port 10259 is in use
        [ERROR Port-10257]: Port 10257 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=...`
To see the stack trace of this error execute with --v=5 or higher
----还是不成功(端口占用、上次初始化生成的文件没删除)----
----重启一下,并删除相应文件---- [root@master1 ~]# reboot -h now
----等待重启完成...---- [root@master1 ~]# rm -rf /etc/kubernetes /var/lib/etcd [root@master1 ~]# kubeadm reset [root@master1 ~]# systemctl daemon-reload [root@master1 ~]# systemctl restart kubelet [root@master1 ~]# kubeadm init --config=/etc/kubeadm/init.default.yaml [init] Using Kubernetes version: v1.23.15 [preflight] Running pre-flight checks [WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly [bootstrap-token] Creating the "cluster-info" ConfigMap in the "kube-public" namespace [kubelet-finalize] Updating "/etc/kubernetes/kubelet.conf" to point to a rotatable kubelet client certificate and key [addons] Applied essential addon: CoreDNS [addons] Applied essential addon: kube-proxy Your Kubernetes control-plane 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 Alternatively, if you are the root user, you can run: export KUBECONFIG=/etc/kubernetes/admin.conf 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/ Then you can join any number of worker nodes by running the following on each as root: kubeadm join 192.168.17.3:6443 --token abcdef.0123456789abcdef \ --discovery-token-ca-cert-hash sha256:9ee892538504ef34f9fe053be22011b2fdac2ad4ab634ee95fdef8f497f86279

 

标签:master1,kubernetes,--,etc,init,失败,kubeadm,kube,root
From: https://www.cnblogs.com/xuruiming/p/17036687.html

相关文章

  • DDL-(Data Definition Language)
    DDL(DataDefinitionLanguage):数据定义语言,用来定义数据库对象(数据库,表,字段)数据库操作1.查询所有数据库showdatabases;2.查询当前数据库selectdatabase();......
  • office word打开网页超链接失败 提示 组织策略阻止我们......
    官方offic指导修改注册表。建议先注册表备份,虽然我没用上。新建txt文档,粘贴下面代码,保存为.reg。然后双击运行。我用了,完美解决“officeword打开网页超链接失败提示组织......
  • ubuntu系统更新或者卸载软件导致索引失败的抢救方法
    #现将info文件夹更名sudomv/var/lib/dpkg/info/var/lib/dpkg/info_old#再新建一个新的info文件夹sudomkdir/var/lib/dpkg/info#更新安装......
  • 有限自动状态机(Finite State Machine)
    有限状态自动机是拥有有限数量的状态,并且每个状态可以变换其他状态的数学模型。Afinite-statemachine(FSM)orfinite-stateautomaton(FSA,plural:automata),fin......
  • Spring5 IOC容器解析——BeanDefinitionReader
    概述BeanDefinitionReader的作用是读取Spring配置文件中的内容,将其转换为IOC容器内部的数据结构:BeanDefinition。在前面章节关于BeanDefinition的学习中有提到XmlB......
  • Spring5 IOC容器解析——BeanDefinition的注册
    前言在上一篇文章解析BeanDefinition对配置文件解析完成后,获取的beanDefiniton已经可以进行使用了,剩下的唯一工作就是注册了,也就是processBeanDefinition方法中的BeanDefi......
  • SQL server数据库 账户SA登录失败,提示错误:18456
    在我们使用数据库的时候,偶尔会遇到一些登录上的错误提示。比如,在数据库配置上没有正确开启用户的登录策略以及服务器身份验证模式时,就会提示“用户’sa’登录失败。(Micros......
  • Spring IOC官方文档学习笔记(七)之Bean Definition继承
    1.BeanDefinition继承(1)Spring中的bean存在层级关系,我们可以定义子bean来继承或覆盖父bean中的某些属性,从而节省编码,在此处Spring运用到了模板设计模式,如下所示//自定......
  • BeanDefinition基本定义
    BeanDefinition定义了Bean的基本元信息、生命周期方法等。描述了SpringBean的基本信息。其初始化方法主要有以下两种方式:本文案例也是基于SpringFramework5.2.2.RELEAS......
  • OpenOCD + DAP-LINK 调试ESP32的失败经历(2)
    背景https://www.cnblogs.com/liteng0305/p/17018299.html上次使用乐鑫编译好的OpenOCD失败,可能是因为没有开启CMSIS-DAP支持,手动开启编译试一下平台UbuntuLinux5.4.......