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:
      containers:
      - name: worker-1
        image: medtune/k8s-tf:train
        args: [ 
          "--train_file",  "/nfs/data/mnist/train.tfrecords",
          "--test_file", "/nfs/data/mnist/test.tfrecords",
          "--out_dir", "/nfs/artefacts/mnist",
        ]
        env:
          - name: TF_CONFIG
            valueFrom:
              configMapKeyRef:
                name: dtf-nodes-configs
                key: node.worker-1
        ports:
          - containerPort: 2222
        resources:
          requests:
            cpu: 1000m
            memory: 1000Mi
          limits:
            cpu: 1500m
            memory: 2500Mi
        volumeMounts:
          - mountPath: /nfs
            name: nfs-volume

      volumes:
        - name: nfs-volume
          persistentVolumeClaim:
            claimName: train-pvc

      restartPolicy: Always