== Targeting a specific node ==
Targeting a specific node can be done in two different ways: # Selecting , either selecting a node name.# Requiring a directly, or requiring certain label labels on the node, .
See table below for node names and associated labels.
Example 1: GPU-enabled pod which runs only on the node "belial":
Example 2: GPU-enabled pod which requires compute capability of at least sm-60:
=== Selecting a node name ===
Example: GPU-enabled pod which runs only on the node "belial":
<syntaxhighlight>
apiVersion: v1
kind: Pod
metadata:
name: gpu-pod
spec:
nodeSelector:
kubernetes.io/hostname: belial
containers:
- name: gpu-container
image: nvcr.io/nvidia/tensorflow:20.09-tf2-py3
command: ["sleep", "1d"]
resources:
requests:
cpu: 1
nvidia.com/gpu: 1
memory: 10Gi
limits:
cpu: 1
nvidia.com/gpu: 1
memory: 10Gi
# more specs (volumes etc.)
</syntaxhighlight>
=== Requiring a certain label on the node ===
Example: GPU-enabled pod which requires compute capability of at least sm-60:
== Acquiring GPUs with more than 20 GB ==