如何启动kubelet服务? [英] How to start kubelet service?

查看:2980
本文介绍了如何启动kubelet服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行了命令 systemctl停止kubelet 然后尝试启动它 systemctl启动kubelet

I ran command systemctl stop kubelet then try to start it systemctl start kubelet

但无法启动

这是 systemctl status kubelet

 kubelet.service - kubelet: The Kubernetes Node Agent
   Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kubelet.service.d
           └─10-kubeadm.conf
   Active: activating (auto-restart) (Result: exit-code) since Wed 2019-06-05 15:35:34 UTC; 7s ago
     Docs: https://kubernetes.io/docs/home/
  Process: 31697 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)
 Main PID: 31697 (code=exited, status=255)

因此,我无法运行任何kubectl命令

Because of this i can't able to run any kubectl command

示例 kubectl获取广告连播给出

The connection to the server 172.31.6.149:6443 was refused - did you specify the right host or port?

推荐答案

所以我需要重置kubelete服务 这是步骤:-

So i need to reset kubelete service Here are the step :-

1)检查您的Docker服务的状态. 如果已停止,请通过cmd sudo systemctl start docekr启动它. 如果没有安装安装 #yum install -y kubelet kubeadm kubectl docker

1) check status of your docker service. If stoped,start it by cmd sudo systemctl start docekr. If not installed installed it #yum install -y kubelet kubeadm kubectl docker

2)通过#swapoff -a

2) Make swap off by #swapoff -a

3)现在通过#kubeadm reset重置kubeadm

3)Now reset kubeadm by #kubeadm reset

4)现在尝试#kudeadm init 之后检查#systemctl status kubelet 它会正常工作

4) Now try #kudeadm init after that check #systemctl status kubelet it will be working

检查节点 kubectl获取节点 如果主节点尚未准备就绪,请参考以下内容 要开始使用群集,您需要以常规用户身份运行以下命令:

Check nodes kubectl get nodes if Master Node is not ready ,refer following 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

如果您无法创建Pod ..check dns kubectl获取容器--namespace = kube-system 如果dns pod处于挂起状态 即您需要使用网络服务 我用印花布

if you not able to create pod ..check dns kubectl get pods --namespace=kube-system if dns pods are in pending state i.e you need to use network service i used calico

kubectl apply -f https://docs.projectcalico.org/v3.7/manifests/calico.yaml

现在您的主节点已经准备好..现在您可以部署pod

Now your master node is ready .. now you can deploy pod

这篇关于如何启动kubelet服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆