<p>I would like to schedule periodically kubernetes jobs (with different images)</p>
<p>These jobs are required to run on a node with GPU support (1 GPU device)</p>
<p>Currently If I create two jobs at the same time - the pods will be scheduled both on the same node - while only one pod will have access to GPU device</p>
<p>Is there a way to configure nodes/pods so that scheduler only places one pod per node and once it is completed places next job ?</p>

Djangonaut
<p>You could set an inter-pod anti-affinity as described in the docs <a href="https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity" rel="nofollow noreferrer">here</a>.</p>
<blockquote>
<p>Inter-pod affinity and anti-affinity rules take the form &quot;this Pod should (or, in the case of anti-affinity, should not) run in an X if that X is already running one or more Pods that meet rule Y&quot;, where X is a topology domain like node, rack, cloud provider zone or region, or similar and Y is the rule Kubernetes tries to satisfy.</p>
</blockquote>
<blockquote>
<p>Similar to node affinity are two types of Pod affinity and anti-affinity as follows:</p>
<ul>
<li>requiredDuringSchedulingIgnoredDuringExecution</li>
<li>preferredDuringSchedulingIgnoredDuringExecution</li>
</ul>
</blockquote>
<blockquote>
<p>Consider the following Pod spec:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: with-pod-affinity
spec:
  affinity:
    podAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
      - labelSelector:
          matchExpressions:
          - key: security
            operator: In
            values:
            - S1
        topologyKey: topology.kubernetes.io/zone
    podAntiAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        podAffinityTerm:
          labelSelector:
            matchExpressions:
            - key: security
              operator: In
              values:
              - S2
          topologyKey: topology.kubernetes.io/zone
  containers:
  - name: with-pod-affinity
    image: registry.k8s.io/pause:2.0
</code></pre>
</blockquote>
