---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gpu-workload-1g-5gb
spec:
  replicas: 2
  selector:
    matchLabels:
      app: gpu-workload-1g-5gb
  template:
    metadata:
      labels:
        app: gpu-workload-1g-5gb
        app-group: gpu-workload
    spec:
      containers:
      - name: gpu-workload-1g-5gb
        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/mig-1g.5gb: "1"
      tolerations:
      - key: "nvidia.com/gpu"
        operator: "Exists"
        effect: "NoSchedule"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gpu-workload-2g-10gb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gpu-workload-2g-10gb
  template:
    metadata:
      labels:
        app: gpu-workload-2g-10gb
        app-group: gpu-workload
    spec:
      containers:
      - name: gpu-workload-2g-10gb
        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/mig-2g.10gb: "1"
      tolerations:
      - key: "nvidia.com/gpu"
        operator: "Exists"
        effect: "NoSchedule"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gpu-workload-3g-20gb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gpu-workload-3g-20gb
  template:
    metadata:
      labels:
        app: gpu-workload-3g-20gb
        app-group: gpu-workload
    spec:
      containers:
      - name: gpu-workload-3g-20gb
        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/mig-3g.20gb: "1"
      tolerations:
      - key: "nvidia.com/gpu"
        operator: "Exists"
        effect: "NoSchedule"
