Commit Graph

183 Commits

Author SHA1 Message Date
Michal Wozniak
c12bcf4e94 Refactor enactJobFinished util function for Job controller 2024-06-20 13:02:54 +02:00
Kubernetes Prow Robot
bd88faee8b
Merge pull request #125520 from mimowo/cleanup-success-policy-check
Remove redundant check in Job success policy code
2024-06-18 12:40:09 -07:00
Michal Wozniak
7a3d73d234 Remove redundant check in Job success policy code 2024-06-14 19:59:40 +02:00
Michal Wozniak
18a14bcff9 Remove unused parameter in Job controller function 2024-06-14 19:43:19 +02:00
Kubernetes Prow Robot
c49b140c45
Merge pull request #125175 from dejanzele/feat/count-terminating-for-failed-jobs
Count terminating pods when deleting active pods for failed jobs
2024-06-10 16:56:37 -07:00
Dejan Pejchev
7dd2948620
count terminating pods when deleting active pods for failed jobs 2024-06-04 11:31:00 +02:00
Tomas Tormo
ce56b2ca58 Remove JobReadyPods feature flag 2024-05-27 13:09:52 +00:00
Michal Wozniak
a6c9d5ba00 Do not remove Job's finalizer from Pod owned by a non-batch/v1 Job 2024-05-14 17:29:23 +02:00
Kubernetes Prow Robot
d2e6c51b05
Merge pull request #123537 from kaisoz/commonize-job-util-functions
Add the util pkg to commonize job util functions
2024-05-07 16:59:28 -07:00
Tomas Tormo
c856c412b9 Add util pkg to commonize job util functions 2024-05-07 09:27:46 +00:00
Alvaro Aleman
6d0ac8c561 Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.
2024-05-04 14:33:12 -04:00
Hiroki Takatsuka
84ffc2fc3d
fix(job_controller): add delay duration to log message when enqueueing job 2024-04-07 16:42:48 +09:00
Yuki Iwai
e216742672 Job: Support for the JobSuccessPolicy (alpha)
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2024-03-08 05:49:09 +09:00
Michał Woźniak
e568a77a93
Support for the Job managedBy field (alpha) (#123273)
* support for the managed-by label in Job

* Use managedBy field instead of managed-by label

* Additional review remarks

* Review remarks 2

* review remarks 3

* Skip cleanup of finalizers for job with custom managedBy

* Drop the performance optimization

* imrpove logs
2024-03-05 09:25:15 -08:00
Mengjiao Liu
b584b87a94 kube-controller-manager: readjust log verbosity
- Increase the global level for broadcaster's logging to 3 so that users can ignore event messages by lowering the logging level. It reduces information noise.
- Making sure the context is properly injected into the broadcaster, this will allow the -v flag value to be used also in that broadcaster, rather than the above global value.
- test: use cancellation from ktesting
- golangci-hints: checked error return value
2024-02-26 14:51:56 +08:00
Michal Wozniak
f84d643c20 Use the Defer for pod replacement policy 2024-02-15 17:37:31 +01:00
Michal Wozniak
115dc90633 Increase accuracy of the pods_creation_total metric and improve test exec time 2024-02-15 10:59:01 +01:00
Yuki Iwai
a85f587984 Job: Use built-in min function instead of integer package
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2023-11-17 14:10:00 +09:00
Dejan Pejchev
88c0a8be1b
feat: add job_pods_creation_total metric 2023-10-24 17:49:04 +02:00
Dejan Zele Pejchev
f8a4e343a1
Fix tracking of terminating Pods when nothing else changes (#121342)
* cleanup: refactor pod replacement policy integration test into staged assertion

* cleanup: remove typo in job_test.go

* refactor PodReplacementPolicy test and remove test for defaulting the policy

* fix issue with missing update in job controller for terminating status and refactor pod replacement policy integration test

* use t.Cleanup instead of defer in PodReplacementPolicy integration tests

* revert t.Cleanup to defer for reseting feature flag in PodReplacementPolicy integration tests
2023-10-24 15:04:46 +02:00
Kubernetes Prow Robot
8149ab3f3f
Merge pull request #121356 from mimowo/backoff-limit-per-index-beta
Graduate BackoffLimitPerIndex to Beta
2023-10-23 18:39:58 +02:00
Michal Wozniak
b0d04d933b Introduce the job_finished_indexes_total metric 2023-10-20 15:19:04 +02:00
Michal Wozniak
6dd0ad5c0f Graduate BackoffLimitPerIndex to Beta 2023-10-19 12:18:36 +02:00
Kubernetes Prow Robot
6d70013af5
Merge pull request #121147 from kannon92/rm-at-least-no-terminating-count
Remove terminating count from rmAtLeast
2023-10-18 00:44:51 +02:00
Kubernetes Prow Robot
27ff547a14
Merge pull request #121011 from kannon92/job-pod-replacement-policy-feature-on-but-api-specified
Fix panic when enablement of pod replacement policy is skewed
2023-10-17 21:28:48 +02:00
Yuki Iwai
201c30fba8
Job: Handle error returned from AddEventHandler function (#119917)
* Job: Handle error returned from AddEventHandler function

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Use the error message the similar to CronJob

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Clean up error messages

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the tesing.T on the second place in the args for the newControllerFromClient function

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the testing.T on the second place in the args for the newControllerFromClientWithClock function

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Call t.Helper()

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the testing.TB on the second place in the args for the createJobControllerWithSharedInformers function and call tb.Helper() there

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the testing.TB on the second place in the args for the startJobControllerAndWaitForCaches function and call tb.Helper() there

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Adapt TestFinializerCleanup to the eventhandler error

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

---------

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2023-10-17 21:28:34 +02:00
Kevin Hannon
7a1ac18bc8 Fix panic if there are more terminating pods than active pods
Co-authored-by: Aldo Culquicondor <1299064+alculquicondor@users.noreply.github.com>
2023-10-17 14:50:38 -04:00
Kevin Hannon
d7ee6b9d1b fix possible panic if pod replacement policy is turned on and jobs do not set pod replacement policy 2023-10-11 08:37:50 -04:00
Kevin Hannon
b96a074bcd convert pointer to ptr for job controller 2023-10-05 09:30:01 -04:00
Kevin Hannon
a62eb45ae2 Rename job reasons to JobReasons as part of api review 2023-09-19 13:10:22 -04:00
Kevin Hannon
c6e9fba79b move reasons to api package for job controller 2023-09-14 13:24:29 -04:00
Sharpz7
43fc6b5bdb Added suggests changes 2023-09-06 03:05:14 +00:00
Sharpz7
e9be1d7438 Test now has coverage! 2023-08-27 05:06:53 +00:00
Sharpz7
cf32ae9453 Initial Commit 2023-08-25 10:35:58 +00:00
Sharpz7
297f04b74a Added function to remove finalizers as backup 2023-08-25 10:35:57 +00:00
Kubernetes Prow Robot
df493712e4
Merge pull request #119874 from kannon92/pod-replacement-policy-typos
fix typos for pod replacement policy
2023-08-17 11:21:34 -07:00
Kubernetes Prow Robot
d5f2420309
Merge pull request #119914 from luohaha3123/job-feature
Job: Change job controller  methods receiver to pointer
2023-08-15 23:14:05 -07:00
lhaha
947c9376f6 change struct methods receiver to pointer 2023-08-12 10:21:14 +08:00
Yuki Iwai
6f27733af8 Job: Replace deprecated workqueue library with supported one
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2023-08-11 20:35:36 +09:00
kannon92
f73c253acc fix typos for pod replacement policy 2023-08-09 20:34:48 +00:00
kannon92
74fcf3e766 implementation of PodReplacementPolicy kep in the job controller 2023-07-21 00:44:53 +00:00
Michal Wozniak
35d0af9243 Include ignored pods when computing backoff delay for Job pod failures 2023-07-19 17:39:58 +02:00
Michał Woźniak
a15c27661e
Job controller implementation of backoff limit per index (#118009) 2023-07-18 13:44:11 -07:00
Kubernetes Prow Robot
84a999923f
Merge pull request #119335 from mimowo/use-final-diff-for-job-pod-creation
Ensure final diff is used for setting expectations for Job pod creation
2023-07-14 15:20:54 -07:00
Kubernetes Prow Robot
6f3856f953
Merge pull request #118883 from danielvegamyhre/kep-4017-job
Add completion index as pod label for indexed jobs
2023-07-14 12:23:50 -07:00
Michal Wozniak
9564bdc39d Ensure final diff is used for setting expectations for Job pod creation 2023-07-14 19:09:39 +02:00
Michal Wozniak
7e3b53042b Pass Job context down to firstPendingIndexes 2023-07-13 16:11:06 +02:00
Patrick Ohly
7d064812bb kube-controller-manager: finish conversion to contextual logging
This removes all exceptions and fixes the remaining unconverted log calls.
2023-07-12 14:57:29 +02:00
Michal Wozniak
bf48165232 Remarks to syncJobCtx 2023-07-11 09:44:08 +02:00
Michal Wozniak
990339d4c3 Introduce syncJobContext to limit the number of function parameters 2023-07-11 09:27:21 +02:00