apiVersion: apps/v1
kind: Deployment
metadata:
  name: neox-data-writer
spec:
  strategy:
    type: Recreate
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: neox-data-writer
  template:
    metadata:
      labels:
        app.kubernetes.io/name: neox-data-writer
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: data-writer
        tty: true
        image: leogao2/megatron-3d
        ports:
          - name: sshd
            containerPort: 2222
            protocol: TCP
        volumeMounts:
          - mountPath: /dev/shm
            name: dshm
          - name: secret-volume
            readOnly: true
            mountPath: "/secrets"
          - name: data-storage
            mountPath: /mnt/ssd-0
            readOnly: false
        resources:
          requests:
            cpu: 30
            memory: 10Gi
        lifecycle:
          postStart:
            exec:
              command: [ "/bin/bash", "/secrets/post_start_script.sh" ]

      volumes:
        - name: dshm
          emptyDir:
            medium: Memory
        - name: secret-volume
          secret:
            secretName: ----secret-name----
            defaultMode: 0777
        - name: data-storage
          persistentVolumeClaim:
            claimName: eleuther-ssd-0
      restartPolicy: Always
