Commit Graph

77 Commits

Author SHA1 Message Date
Aldo Culquicondor
eebd678cda Remove GET job and retries for status updates.
Doing a GET right before retrying has 2 problems:
- It can masquerade conflicts
- It adds an additional delay

As for retries, we are better of going through the sync backoff.

In the case of conflict, we know that there was a Job update that would trigger another sync, so there is no need to do a rate limited requeue.
2021-09-23 11:48:34 -04:00
Aldo Culquicondor
7868fbbe64 Revert "Add metric job_pod_finished"
This reverts commit a0e7a567c5.
2021-09-21 15:16:54 -04:00
Aldo Culquicondor
8bcb780808 Revert "Limit number of Pods counted in a single Job sync"
This reverts commit 7d9cb88fed.
2021-09-21 15:16:50 -04:00
Aldo Culquicondor
a0e7a567c5 Add metric job_pod_finished
To count the number of pods that the job controller successfully tracked with the JobTrackingWithFinalizers feature gate.
2021-09-15 11:19:47 -04:00
Aldo Culquicondor
7d9cb88fed Limit number of Pods counted in a single Job sync
This prevents big Jobs from starving smaller ones.
2021-09-10 10:32:04 -04:00
Aldo Culquicondor
23ea5d80d6 Fix Job tracking with finalizers for more than 500 pods
When doing partial updates for uncountedTerminatedPods, the controller might have removed UIDs for Pods which still had finalizers.

Also make more space by removing UIDs that don't have finalizers at the beginning of the sync.
2021-09-01 16:19:04 -04:00
Aldo Culquicondor
5e1b5ec398 Revert counting deleted pods as failures for Job
When JobTrackingWithFinalizers is disabled. To preserve existing behavior.

Change-Id: Id1752f96feed322911712fe9e918e91e42eca809
2021-07-14 10:03:20 -04:00
Aldo Culquicondor
2dd2622188 Track Job Pods completion in status
Through Job.status.uncountedPodUIDs and a Pod finalizer

An annotation marks if a job should be tracked with new behavior

A separate work queue is used to remove finalizers from orphan pods.

Change-Id: I1862e930257a9d1f7f1b2b0a526ed15bc8c248ad
2021-07-08 17:48:05 +00:00
Adhityaa Chandrasekar
ba708e5fc9 graduate SuspendJob to beta
Also adds a label to two existing Job metrics.

Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2021-06-03 18:48:32 +00:00
Aldo Culquicondor
d8aad7944c Remove unused util CreatePods
And rename CreatePodsWithControllerRef to simply CreatePods
2021-05-20 20:27:21 +00:00
Mengxue Zhang
e64e34e029 specify pod name and hostname in indexed job 2021-05-19 15:30:13 +00:00
Kubernetes Prow Robot
548fb43643
Merge pull request #101292 from AliceZhang2016/job_controller_metrics
Graduate indexed job to beta
2021-05-07 13:31:44 -07:00
Mengxue Zhang
5fd4ab3dc3 add pod create/delete operation limitations per job sync 2021-04-27 18:51:38 +00:00
Mengxue Zhang
cda503fcc9 indexed job: add three metrics to job controller 2021-04-27 18:32:53 +00:00
Mengxue Zhang
4cf7e75841 indexed job: remove pods with invalid index 2021-04-19 14:07:07 +00:00
Kubernetes Prow Robot
0172cbf56c
Merge pull request #99963 from alculquicondor/job_complete_active
Remove active pods past completions
2021-04-08 17:10:10 -07:00
Adhityaa Chandrasekar
0a21157c96 job controller: don't mutate shared cache object
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2021-03-25 06:36:15 +00:00
Aldo Culquicondor
e6c3d7b34d Only default Job fields when feature gates are enabled
Also use pointer for completionMode enum
2021-03-12 20:46:52 +00:00
Aldo Culquicondor
4af432bab3 Remove active pods past completions 2021-03-10 14:55:40 +00:00
Aldo Culquicondor
8ae0ad2b2f Fix completed indexed job with repeated indexes 2021-03-09 19:22:45 +00:00
Adhityaa Chandrasekar
a0844da8f7 batch: add suspended job
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2021-03-08 20:08:21 +00:00
Aldo Culquicondor
8812531b8c Add completion index to Job Pods
When .spec.completionMode="Indexed"
2021-03-03 22:45:53 +00:00
KeZhang
67b40a50c6 Optimize log output 2020-12-08 11:20:24 +08:00
yodarshafrir1
24010022ef Number of failed jobs should exceed the backoff limit and not big equal.
Remove patch in e2e test of backoff limit due to usage of NumRequeues
2020-08-11 11:06:09 +03:00
yodarshafrir1
ca420ddada Fix job's backoff limit for restart policy Never, rely on number of failures instead of number of NumRequeues 2020-08-07 14:22:40 +03:00
Kubernetes Prow Robot
00d6255f44
Merge pull request #91712 from KobayashiD27/structured-logging-in-event
Migrate log to klog.InfoS for staging/src/k8s.io/client-go
2020-06-22 23:53:40 -07:00
Kubernetes Prow Robot
be31023a95
Merge pull request #87155 from kolorful/patch-3
Fix a comment in job_controller
2020-06-19 08:51:58 -07:00
Kobayashi Daisuke
4ae11dac2e Replace StartLogging(klog.Infof) with StartStructuredLogging(0) 2020-06-15 17:48:35 +09:00
KeZhang
884f94ad92 Do not swallow NotFound error for DeletePod in dsc.manage 2020-06-04 16:41:38 +08:00
Zhou Peng
bc9bff0d9e [pkg/controller/job]: fix comment typo
Signed-off-by: Zhou Peng <p@ctriple.cn>
2020-05-30 23:09:10 +08:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Kubernetes Prow Robot
b17ddac4df
Merge pull request #78944 from avorima/golint_fix_job
Fix golint errors in pkg/controller/job
2020-04-12 21:57:47 -07:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Kubernetes Prow Robot
e4926e2d70
Merge pull request #85421 from terrytangyuan/patch-1
Fix grammar: have -> has
2020-01-22 08:40:58 -08:00
Kewei Ma
34fce9faee
Fix a comment in job_controller 2020-01-13 10:09:06 -06:00
Kubernetes Prow Robot
42fe74cd2c
Merge pull request #86142 from raz-bn/add-complete-event
Adding new job completed event
2019-12-16 23:43:58 -08:00
raz-bn
0224c48120 Job completed event added 2019-12-16 21:41:15 +00:00
Ted Yu
9cff345770 Do not swallow timeout in manageReplicas 2019-12-12 11:27:36 -08:00
Yuan Tang
dd308ca576
Fix grammar: have -> has 2019-11-18 11:17:58 -05:00
Clayton Coleman
c6e34e58c5
job: Ignore namespace termination errors when creating pods or jobs
Instead of reporting an event or displaying an error, simply exit
when the namespace is being terminated. This reduces the amount of
controller churn on namespace shutdown. While we could technically
exit the entire processing loop early for very large jobs,
we should wait for more evidence that is an issue before changing
that logic substantially.
2019-10-20 18:39:01 -04:00
Yassine TIJANI
c1487840bc move util/metrics to component-base
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-10-08 14:42:31 +02:00
Yassine TIJANI
7e4c3096fe move WaitForCacheSync to the sharedInformer package
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-08-22 16:13:41 +01:00
Ted Yu
898f099346 Skip unnecessary operations if diff is less than 0 2019-07-17 14:03:08 -07:00
Mario Valderrama
6ac7421535 Update comments 2019-06-14 14:23:13 +02:00
Mario Valderrama
dbbe68601f Fix golint errors in pkg/controller/job 2019-06-12 20:09:57 +02:00
Fei Xu
9feb0df370 Add pending status for pastBackoffLimitOnFailure 2019-05-21 09:45:29 +08:00
Andrew Kim
0bc5508aca replace client-go/util/integer with k8s.io/utils/integer 2019-01-24 15:34:21 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
k8s-ci-robot
e6c5fb4666
Merge pull request #67859 from goodluckbot/job-controller-backoffLimit
Fix pastBackoffLimitOnFailure in job controller
2018-10-11 05:49:30 -07:00