-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom BackoffLimit & concurrencyPolicy for SCDF Tasks are not passed to PODS while executing in Openshift environment #398
Comments
looks more an unimplemented use case than bug. also |
I can add the concurrencyPolicy directly to the cronjob.yaml created in Openshift environment when a scheduled task is being submitted. However I couldn't do the same for backoffPolicy. Is there any workaround we have for setting backoff limit ? |
please provide
|
I cannot edit the actual post as it's not created by me. Hence posting the steps to reproduce.
Now once the SCDF deployed in openshift environment, I imported the batch job application as Docker Image using Docker URI instead of maven repo URL. I actually built my batch application in openshift environment and used that Docker URI. Now I can schedule the Batch job available and the request is submitted to openshift environment. Below is the config-map used by the tasks.
the image-pull-policy property is getting transported to openshift. But not,
I found this is not transported to openshift by going to cluster console -> Workloads ->Cronjobs. Then choose the corresponding openshift project from the dropdown list available at the top. In the image above I could edit the yaml for any job we scheduled in scdf. It also accepts properties like concurrencyPolicy: forbid. However I don't find any property for backoffLimit. our jobs would run at very close intervals. Mostly between 2-3 minutes. So in case if a job fails then the pod is getting created for 6 times, and it takes more than 5 minutes for all of them to complete. In the meantime the next scheduled execution also starts and fails which creates another 6 pods . This exhausts the resource in no time. So It would be great if there's any such property to limit pod creation on failure. |
looks like there are a couple things here.. i don't have openshift to test against but that's likely not a concern. i've made an attempt to reproduce what your seeing and made the notes below as long as opened some issues to track. 1 - the kubernetes property 2 - the deployer property 3 - in regards to a) when a task is created by default, a "bare pod" is used unless you set the deployer property
while the above should work, in the current state, the b) to work around
results in the following objects: the job:
the spawned pod:
when inspecting the
4 - when scheduling a task, setting the backoffLimit on a I think only spring-cloud/spring-cloud-dataflow#4186 needs to be resolved to close this issue as its the only "bug". the others are logged feature enhancements or incorrect property usage. |
It's seems that just add in class KubernetesDeployerProperty
and in KubernetesScheduler: and it should works. Anyone? |
I'm not able to make this work. I tried to create a scheduler from the scdf UI, once with spring.cloud.deployer.kubernetes.backoffLimit=1 as argument and once with deployer.kubernetes.backoffLimit=1 as property, but in both cases they are not taken into account. Any suggestion? Tnx |
Hi @onobc, i'm trying to add the backoffLimit from the schedules view, not the launch view |
Yeh, my bad on the screens @saulgiordani - you are in the scheduler. Still, try my suggestion of instead using the property Note, the scheduler properties ( |
Hi @onobc, i've tried with the following parameters in the properties text area:
The 1st property is taken correctly (if I use deployer instead of scheduler IS NOT TAKEN), the 2nd is not. |
It seems that it's not possible. BackoffLimit is not exposed in KubernetesScheduler: |
Good catch @imitbn , I will add this to the KubernetesScheduler as well @saulgiordani . |
Great, thanks! |
If all goes well, we can get it squeezed into 2.10.3 which is planned to release in a few days. |
Closing this in favor of #407 as I think everything else besides that is done in this issue. |
Hi, the following is working fine for me: If you want to set it through the scheduler, put this as property: and you will see that the pod definition includes the backoffiLimit |
That's the way, this behaviour has actually been added in the scdf 2.10.3 |
@Srkanna commented on Sat Sep 19 2020
I'm trying to set a backoffLimit & concurrencyPolicy for batch jobs which are executed in Openshift environment via SCDF. Currently I'm setting these two at the global server config level. The resource limits, imagePullPolicy configurations are being passed to the CronJob but not backoffLimit and concurrencyPolicy.
I'm experiencing this in 2.6.1 and earlier versions as well. Below is the server-config.yaml.
Both backoffLimit and maxCrashLoopBackOffRestarts are not passed to POD configuration. I still see PODS are getting restarted 6 times instead of 1 time after a failure. Below is the CronJob.yaml which I extracted from the Openshift cluster console after creating the schedule in SCDF for a batch job.
Kindly let me know your inputs. @ilayaperumalg @sabbyanandan
@ilayaperumalg commented on Mon Sep 21 2020
Hi @Srkanna,
This looks like a bug. Moving this to Spring Cloud Deployer Kubernetes. Thanks for reporting.
The text was updated successfully, but these errors were encountered: