How to start & stop Kubernetes 1.8.5 cluster?

12/12/2017

Question

What are the commands to start/stop the K8S cluster? After installation is done following Using kubeadm to Create a Cluster, restarted the CentOS server and the K8S cluster is not running after restart.

There are services mentioned in Fedora (Single Node) listing services but there are no such services installed via kubeadm.

Failed to restart etcd.service: Unit not found.
Failed to restart kube-apiserver.service: Unit not found.
Failed to restart kube-controller-manager.service: Unit not found.

Environment

CentOS 7 on Virtual Box. K8S 1.8.5

$ kubectl get nodes
NAME      STATUS    ROLES     AGE       VERSION
master    Ready     master    36m       v1.8.5
node01    Ready     <none>    35m       v1.8.5
node02    Ready     <none>    35m       v1.8.5
-- mon
kubeadm
kubernetes

1 Answer

12/12/2017

As you are using kubeadm to initiate and administrate the k8s cluster.As I understand kubeadm use following approach

Systemd manage only kubelet service on the node.

Kubelet create and manage k8s control plane componenets (kube-api server, kube-controller-manager , etcd and scheduler, kube-proxy) as a static pod.

Kubelet access their json manifest files from /etc/kubernetes/manifests.

So if you want to remove control plane components you just need to move these manifest files in another directory.

-- Suresh Vishnoi
Source: StackOverflow