apiVersion: apps/v1
kind: Deployment
metadata:
  name: keras
  namespace: digits
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: keras
  template:
    metadata:
      labels:
        k8s-app: keras
    spec:
      tolerations:
      - key: "region"
        operator: "Equal"
        value: "allow"
        effect: "NoSchedule"
      containers:
      - name: keras
        image: gitlab-registry.nautilus.optiputer.net/byungheon-jeong/keras-smoke-detection
        securityContext:
          capabilities:
            add:
              - NET_ADMIN
        command: ["/bin/sh", "-c"]
        args: ["sleep infinity"]
        resources:
          limits:
            nvidia.com/gpu: 1
            memory: "64Gi"
            cpu: "8"
          requests:
            memory: "32Gi"
            cpu: "4"

        volumeMounts:
        - mountPath: /userdata/kerasData
          name: modeltraining
      volumes:
        - name: modeltraining
          persistentVolumeClaim:
            claimName: modeltraining
            
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: gpu-type
                operator: In # Use NotIn for other types
                values:
                - M40
