apiVersion: v1
kind: Pod
metadata:
  name: pod-gpu-1
  labels:
    app: app
spec:
  containers:
    - command:
        - sleep
        - infinity
      image: gcr.io/hai-gcp-models/img-torch1.8
      name: pod-gpu-1
      resources:
        limits:
          nvidia.com/gpu: 2
        requests:
          nvidia.com/gpu: 2
      volumeMounts:
        - name: pv-tutorial
          mountPath: /home
        - name: dshm
          mountPath: /dev/shm
  volumes:
    - name: pv-tutorial
      persistentVolumeClaim:
        claimName: pvc-tutorial
    - name: dshm
      emptyDir:
        medium: Memory
  restartPolicy: Never
  nodeSelector:
    cloud.google.com/gke-accelerator: nvidia-tesla-a100
    cloud.google.com/gke-nodepool: pool-1
  tolerations:
    - key: "nvidia.com/gpu"
      operator: "Equal"
      value: "present"
      effect: "NoSchedule"
