简体   繁体   中英

How to stop kubelet service running in an RKE kubernetes worker node

I need to simulate Node "NotReady" status for a node and tried to stop kubelet to achieve that. But am getting the below error. Looks like this is not the right command for my k8s environment. I need this to verify the working of taints and tolerations.

systemctl stop kubelet.service

Failed to stop kubelet.service: Unit kubelet.service not loaded.

RKE is a K8s distribution that runs entirely within Docker containers as per documentation . That means that none of the K8s services are native Linux services. Try docker ps , and you'll find a container named kubelet running (among others).

So to stop kubelet service on RKE clusters, you'll need to stop the container:

docker stop kubelet

To use systemctl stop kubelet , first this needs to be added to systemd by running command systemctl enable kubelet post that stop command can be used to stop the kubelet.

By running ps -ef kubelet process can be identified and stop it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM