apiVersion: apps/v1
kind: Deployment
metadata:
  name: worker-1
  namespace: medtune
spec:
  replicas: 1
  selector:
    matchLabels:
      name: worker-1
  template:
    metadata:
      name: worker-1
      labels:
        name: worker-1
    spec:
      nodeSelector:
        cloud.google.com/gke-accelerator: nvidia-tesla-k80
      containers:
      - name: worker-1
        image: medtune/k8s-tf:train-mura-gpu-v2
        args: ["/etc/train/config.yaml", "/etc/train/config.yaml"]
        env:
          - name: TF_CONFIG
            valueFrom:
              configMapKeyRef:
                name: mura
                key: node.worker-1
        ports:
          - containerPort: 2222
        resources:
          requests:
            cpu: 3000m
            memory: 10000Mi
            nvidia.com/gpu: 1
          limits:
            cpu: 5000m
            memory: 15000Mi
            nvidia.com/gpu: 1

        volumeMounts:
          - mountPath: /nfs
            name: nfs-volume
          - mountPath: /etc/train
            name: train-config

      volumes:
        - name: nfs-volume
          persistentVolumeClaim:
            claimName: train-pvc
        - name: train-config
          configMap:
            name: mura-config

      restartPolicy: Always