serverless / serverless-kubeless

This plugin enables support for Kubeless within the Serverless Framework.
Apache License 2.0
303 stars 81 forks source link

Cronjob trigger pods are not removed after completing #195

Open remacr opened 5 years ago

remacr commented 5 years ago

BUG REPORT

What happened: The pods created with the scheduled functions are not being removed after completing them. We can see the pods being piled every time it hits the schedule.

Screen Shot 2019-11-12 at 3 22 24 PM

What you expected to happen: The pods to be removed or to reuse the same pod and just running again.

Environment:

andresmgot commented 5 years ago

Hi @raul-madrigal,

That's the default successfulJobsHistoryLimit: 3 set by Kubernetes for CronJobs but it's true that it's not configurable at this moment.

remacr commented 5 years ago

Hi @andresmgot,

Can you guide me somehow? , I would like to help to get this done because I currently have this issue happening and I'm fixing it running a separate script to clean up the completed pods.

andresmgot commented 5 years ago

Just to confirm, you are seeing 3 completed jobs per scheduled function, right?

Unfortunately, this is not something that can be implemented in the client side (so I am not sure is worth working on). If you want to implement it, you need to change it in the CronJobTrigger controller:

https://github.com/kubeless/cronjob-trigger/blob/master/pkg/apis/kubeless/v1beta1/cronjob_trigger.go#L34

Release a new version of the trigger controller and then change the client here.

remacr commented 5 years ago

Yes, I'm seeing 3 jobs scheduled per function marked as completed.

Thanks, I'll take a look.