apiVersion: v1
kind: Pod
metadata:
  name: populate-data
spec:
  containers:
  - name: populate-data
    image: alpine:3.12.0
    command: ["/bin/sh", "-c"]
    # rm file if exist; download file; split it in ~10 parts; rm file
    args:
      - rm -rf /mnt/yellow_tripdata_2019-01.csv && wget https://s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2019-01.csv -P /mnt &&
        wget -O - https://raw.githubusercontent.com/ballista-compute/ballista/main/dev/split-csv.sh | /bin/sh -s /mnt/yellow_tripdata_2019-01.csv 766779 /mnt/nyctaxi/csv &&
        rm -rf /mnt/yellow_tripdata_2019-01.csv
    volumeMounts:
    - mountPath: /mnt
      name: data
  restartPolicy: Never
  volumes:
  - name: data
    persistentVolumeClaim:
      claimName: data-pv-claim
