Commit Graph

194 Commits

Author SHA1 Message Date
Michal Wozniak
1be4df6e02 Cleanup Job controller isPodFailed function 2024-07-18 09:08:23 +02:00
carlory
dae05f3b88 cleanup after JobPodFailurePolicy is promoted to GA 2024-07-18 10:00:56 +08:00
Kubernetes Prow Robot
5d40866fae
Merge pull request #125994 from carlory/fix-job-api
clean up codes after PodDisruptionConditions was promoted to GA
2024-07-17 14:37:09 -07:00
Michal Wozniak
fb7704ba03 Delay setting terminal Job conditions until all pods are terminal
Fix the integration test typecheck

Fix after rebase

# Conflicts:
#	pkg/controller/job/job_controller_test.go
2024-07-11 20:54:09 +02:00
carlory
850bc09e9b clean up codes after PodDisruptionConditions was promoted to GA and locked to default 2024-07-11 10:40:21 +08:00
Kubernetes Prow Robot
135f2e0372
Merge pull request #125997 from mimowo/job-comment-cleanup
Cleanup TODO comment in the Job controller
2024-07-10 12:15:39 -07:00
Michal Wozniak
8a8717c3a9 Cleanup TODO comment in the Job controller 2024-07-10 12:27:56 +02:00
Tomas Tormo
2aed11ec78 job_controller: Ignore FailureTarget!=True 2024-07-10 08:02:14 +00:00
Dejan Zele Pejchev
11b6e4c404
count ready pods when deleting active pods for failed jobs 2024-06-21 01:07:40 +02:00
Kubernetes Prow Robot
cc2946e5d1
Merge pull request #125515 from mimowo/refactor-terminating-counter
Refactor tracking of terminating pods in Job controller
2024-06-20 13:01:41 -07:00
Michal Wozniak
c12bcf4e94 Refactor enactJobFinished util function for Job controller 2024-06-20 13:02:54 +02:00
Michal Wozniak
8cec2c7470 Refactor tracking of terminating pods in Job controller 2024-06-20 09:35:56 +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