How to schedule pods on specific minions

2 views
Skip to first unread message

Pierre-David Bélanger

unread,
Mar 17, 2015, 12:00:08 AM3/17/15
to google-c...@googlegroups.com
The use case is simple:
I want to schedule web app pod on standard instance, and worker pod on highcpu instance.

In the scheduler code (https://github.com/GoogleCloudPlatform/kubernetes/blob/master/pkg/scheduler/predicates.go) I see a func called CheckNodeLabelPresence, but I fail to understand how I can use this.

I guess, this means there is a way to tag minons ?

For example,
I would start:
- two standard instances: node-1, node-2 and tag them with {"tier":"web"},
- two highcpu instances: node-3, node-4 and tag them with {"tier":"worker"},
Then create:
- a controller for a web app podTemplate tagged with {"tier":"web"}
- a controller for a worker app podTemplate tagged with {"tier":"worker"}
I would expect that:
- the web apps runs on the two standard instances,
- the worker apps runs on the two highcpu instances.

I hope it make sense :)

Brendan Burns

unread,
Mar 17, 2015, 12:37:32 AM3/17/15
to google-c...@googlegroups.com

You could do this.  You need to set appropriate labels on the nodes and the set the nodeSelector field on your pods.

Let us know if you run into problems.

Brendan

--
You received this message because you are subscribed to the Google Groups "Containers at Google" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-contain...@googlegroups.com.
To post to this group, send email to google-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-containers.
For more options, visit https://groups.google.com/d/optout.

Pierre-David Bélanger

unread,
Mar 17, 2015, 9:33:37 AM3/17/15
to google-c...@googlegroups.com
Ho, yes I found this page while searching with the term "nodeSelector":
I will try this.

I guess its a new feature, because I did not see it on the the Google Container Engine docs.

The label command do not talk about minion:

Nor the pod manifest spec talk about a nodeSelector field:

I should use the kubernetes documentation directly :)

Thank you!
Reply all
Reply to author
Forward
0 new messages