Use exclusive GPU

Allocate device core to container

To use a GPU in exclusive mode — the default behavior of nvidia-k8s-device-plugin — only specify nvidia.com/gpu; no other resource fields are needed.

apiVersion: v1
kind: Pod
metadata:
  name: gpu-pod
spec:
  containers:
    - name: ubuntu-container
      image: ubuntu:18.04
      command: ["bash", "-c", "sleep 86400"]
      resources:
        limits:
          nvidia.com/gpu: 2 # requesting 2 vGPUs