Search code examples
kubernetesspring-cloud-dataflowspring-cloud-taskkubernetes-cronjob

Scheduled task in SCDF with Kubernetes persistent volume


I'm trying to run a Task in SCDF on minikube. This task extracts data from a database and write them into a file. So I use a local persistent volume I configured in Kubernetes Dashboard to get my file. It works fine when I run a simple execution with deployer parameters :

deployer.my-task.kubernetes.volumes=[ { name: vol-data, persistentVolumeClaim: {claimName: 'pv-data-claim'}} ]
deployer.my-task.kubernetes.volumeMounts=[ { name: 'vol-data', mountPath: '/data' } ]

When I look at the pod yaml file, I see my volume properties :

spec:   
  volumes:
    - name: vol-data
      persistentVolumeClaim:
        claimName: pv-data-claim

and

   volumeMounts:
     - name: vol-data
       mountPath: /data

And I get my file in my local directory at the end of the execution.

But when I tried to create a scheduled task with the same parameters, it doesn't work. I didn't see my volume properties in the cronjob yaml or in the pod launched by the cronjob and of course I didn't get my file.

Am I missing something ? I was thinking that launching a simple task or scheduled task from SCDF would be the same

Thanks for your help


Solution

  • Unfortunately, the scheduling support in SCDF doesn't include the persistentVolumeClaim support yet [see: spring-cloud/spring-cloud-scheduler-kubernetes#21].

    We have an open issue to bring the Scheduler up to the same level as regular app deployment or task launches. Feel free to subscribe to the notifications/updates: spring-cloud/spring-cloud-deployer-kubernetes#331.