Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a pod without scheduler in Kubernetes

Tags:

kubernetes

I searched the documentation but I am unable to find out if I can run a pod in Kubernetes without Scheduler. If anyone can help with any pointers it would be helpful

Update: I can attach a label to node and let pod stick to that label but that would involve going through the scheduler. Is there any method without daemonset and does not use scheduler.

like image 865
Mehul Avatar asked Sep 24 '17 13:09

Mehul


People also ask

How do I stop Kubernetes scheduler?

stop kube-scheduler and kube-controller-manager by running sudo docker stop kube-scheduler kube-controller-manager. stop kube-apiserver by running sudo docker stop kube-apiserver. stop docker by running sudo service docker stop or sudo systemctl stop docker. shutdown the system sudo shutdown now.

Why are pods by default not scheduled on master?

Security pods are not scheduled since the master nodes do not meet the required memory or CPU requirements. The output has the information about memory and CPU requirements. If the resource requirement is not met, increase the master node's memory or CPU.

How do you manually schedule a pod Kubernetes?

We can manually assign the PODs to nodes yourself. Without a scheduler the easiest way to schedule a POD is to simply set the nodeName field to the name of the node in your POD specification file while creating the POD. The POD then gets assigned to the specified node.


2 Answers

The scheduler just sets the spec.nodeName field on the pod. You can set that to a node name yourself if you know which node you want to run your pod, though you are then responsible for ensuring the node has sufficient resources to run the pod (enough memory, free host ports, etc… all things the scheduler is normally responsible for checking before it assigns a pod to a node)

like image 56
Jordan Liggitt Avatar answered Sep 20 '22 14:09

Jordan Liggitt


You want static pods

Static pods are managed directly by kubelet daemon on a specific node, without API server observing it. It does not have associated any replication controller, kubelet daemon itself watches it and restarts it when it crashes.

like image 35
Janos Lenart Avatar answered Sep 22 '22 14:09

Janos Lenart