serverless-kubeless icon indicating copy to clipboard operation
serverless-kubeless copied to clipboard

Cronjob trigger pods are not removed after completing

Open remacr opened this issue 6 years ago • 4 comments

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:

  • Kubernetes version:
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.3", GitCommit:"5e53fd6bc17c0dec8434817e69b04a25d8ae0ff0", GitTreeState:"clean", BuildDate:"2019-06-06T01:36:19Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
  • Kubeless version: 1.0.4
  • Cloud provider or physical cluster: physical cluster

remacr avatar Nov 12 '19 21:11 remacr

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.

andresmgot avatar Nov 13 '19 09:11 andresmgot

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.

remacr avatar Nov 13 '19 15:11 remacr

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.

andresmgot avatar Nov 13 '19 16:11 andresmgot

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

Thanks, I'll take a look.

remacr avatar Nov 13 '19 17:11 remacr