apiVersion: apps/v1
kind: Deployment
metadata:
  name: gpu-workload
spec:
  replicas: 7
  selector:
    matchLabels:
      app: gpu-workload
  template:
    metadata:
      labels:
        app: gpu-workload
    spec:
      nodeSelector:
        nvidia.com/device-plugin.config: time-slice-10
      containers:
      - name: gpu-workload
        image: nvidia/cuda:12.4.0-runtime-ubuntu22.04
        command:
        - bash
        - -c
        - |
          nvidia-smi -L; sleep infinity
        resources:
          limits:
            cpu: "100m"
            memory: "128Mi"
            nvidia.com/gpu.shared: "1"
      tolerations:
      - key: "nvidia.com/gpu"
        operator: "Exists"
        effect: "NoSchedule"
