Difference between revisions of "Tips:How to ensure your pod ends up on a specific node"

From Collective Computational Unit
Jump to navigation Jump to search
(Created page with "== Specifying node placement in the pod == Node affinity is specified with a node selector as follows. Here, the system will try to place the pod on the node "vecna", i.e. th...")
 
m (Specifying node placement in the pod)
Line 1: Line 1:
 
== Specifying node placement in the pod ==
 
== Specifying node placement in the pod ==
  
Node affinity is specified with a node selector as follows. Here, the system will try to place the pod on the node "vecna", i.e. the DGX2.
+
Node affinity is specified with a node selector as follows. Here, the system will try to place the pod on the node with hostname "vecna", i.e. the DGX2.
  
 
<syntaxhighlight lang="yaml">
 
<syntaxhighlight lang="yaml">
Line 17: Line 17:
  
 
[https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ Assigning pods to nodes (Kubernetes tutorial)]
 
[https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ Assigning pods to nodes (Kubernetes tutorial)]
 
  
 
== Node labels pre-defined in the cluster which can be used to specify pod affinity and selectors ==
 
== Node labels pre-defined in the cluster which can be used to specify pod affinity and selectors ==
  
 
TODO
 
TODO

Revision as of 12:23, 4 July 2020

Specifying node placement in the pod

Node affinity is specified with a node selector as follows. Here, the system will try to place the pod on the node with hostname "vecna", i.e. the DGX2.

apiVersion: batch/v1
kind: Pod
metadata:
  name: ...
spec:
  nodeSelector:
    kubernetes.io/hostname: vecna


There is a ton of different options and other possibilities, see

Assigning pods to nodes (Kubernetes tutorial)

Node labels pre-defined in the cluster which can be used to specify pod affinity and selectors

TODO