Commit Graph

6297 Commits

Author SHA1 Message Date
Aldo Culquicondor
6b4ab616a2
Increase range of job_sync_duration_seconds
Change-Id: I7ed4b006faecf0a7e6e583c42b4d6bc4b786a164
2023-09-11 18:01:33 -04:00
Kubernetes Prow Robot
aa4ec3c5b0
Merge pull request #119944 from Sharpz7/jm/backup-finalizers
Adding backup code for removing finalizers to more Job End States.
2023-09-11 09:30:30 -07:00
Sharpz7
7e4b5d0d49 Final Fix 2023-09-08 14:44:22 +00:00
Stephen Kitt
aa89e6dc97
Use ptr.To to retrieve intstr addresses
This uses the generic ptr.To in k8s.io/utils to replace functions and
code constructs which only serve to return pointers to intstr
values. Other uses of the deprecated pointer package are updated in
modified files.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2023-09-08 11:10:50 +02:00
Sharpz7
43fc6b5bdb Added suggests changes 2023-09-06 03:05:14 +00:00
Kubernetes Prow Robot
73580b2038
Merge pull request #120336 from pohly/dra-generated-name-hyphen
resource claim controller: separate generated suffix from base
2023-09-05 11:22:51 -07:00
Kubernetes Prow Robot
8e2b12a220
Merge pull request #119068 from lauchokyip/podgc-unit-test
added podgc orphaned pod unit tests
2023-09-05 03:19:49 -07:00
Patrick Ohly
3c2cfd9a4f resource claim controller: separate generated suffix from base
When the resource claim name inside the pod had some suffix like "1a" in
"resource-1a", the generated name suffix got added directly after that, leading
to "my-pod-resource-1ax6zgt".

Adding another hyphen makes the result more readable: "my-pod-resource-1a-x6zgt".
2023-09-04 09:45:25 +02:00
Kubernetes Prow Robot
1cadbd5887
Merge pull request #120172 from DrAuYueng/fix-log-in-deployment-controller
Fix pod deletion log in deployment controller
2023-09-01 11:28:31 -07:00
Albert Sverdlov
a46bab6930
Fix a job quota related deadlock (#119776)
* Fix a job quota related deadlock

In case ResourceQuota is used and sets a max # of jobs, a CronJob may get
trapped in a deadlock:
  1. Job quota for a namespace is reached.
  2. CronJob controller can't create a new job, because quota is
     reached.
  3. Cleanup of jobs owned by a cronjob doesn't happen, because a
     control loop iteration is finished because of an error to create a
     job.

To fix this we stop early quitting from a control loop iteration when
cronjob reconciliation failed and always let old jobs to be cleaned up.

* Dont reorder imports

* Don't stop requeuing on reconciliation error

Previous code only logged the reconciliation error inside jm.sync() and
didn't return the reconciliation error to it's invoker
processNextWorkItem().

Adding a copy-paste back to avoid this issue.

* Remove copy-pasted cleanupFinishedJobs()

Now we always call jm.cleanupFinishedJobs() first and then
jm.syncCronJob().

We also extract cronJobCopy and updateStatus outside jm.syncCronJob
function and pass pointers to them in both jm.syncCronJob and
jm.cleanupFinishedJobs to make delayed updates handling more explicit
and not dependent on the order in which cleanupFinishedJobs and
syncCronJob are invoked.

* Return updateStatus bool instead of changing the reference

* Explicitly ignore err in tests to fix linter
2023-08-31 08:25:00 -07:00
Sharpz7
e9be1d7438 Test now has coverage! 2023-08-27 05:06:53 +00:00
DrAuYueng
a4ce32769f fix pod delete log in deployment controller
Signed-off-by: DrAuYueng <ouyang1204@gmail.com>
2023-08-25 22:20:51 +08:00
Adam McArthur
0bc0256093
Update job_controller_test.go 2023-08-25 08:15:53 -06:00
Sharpz7
22f4b1c56a Static check fix 2023-08-25 11:35:05 +00:00
Sharpz7
70e2deb32f Fixing lint problem 2023-08-25 11:08:59 +00:00
Sharpz7
6ded53ce4d Added back test changes 2023-08-25 10:35:58 +00:00
Sharpz7
5fb049ff47 Added create job & cleanup 2023-08-25 10:35:58 +00:00
Sharpz7
ff1659cb79 Added syncjob 2023-08-25 10:35:58 +00:00
Sharpz7
f87cc43cdb Review Changes 2023-08-25 10:35:58 +00:00
Sharpz7
d08fc3a4d0 Another one creeped in 2023-08-25 10:35:58 +00:00
Sharpz7
ef6a0eb6d8 Final Lint Fix 2023-08-25 10:35:58 +00:00
Sharpz7
aa9f38c36d More Lint Fixes 2023-08-25 10:35:58 +00:00
Sharpz7
601679446a Lint fixes 2023-08-25 10:35:58 +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
f852d7fead
Merge pull request #118653 from pohly/volume-resource-requirements
Volume resource requirements
2023-08-21 14:08:05 -07:00
Kubernetes Prow Robot
6cbc5dfac6
Merge pull request #114095 from aimuz/fix-114083
scheduler: Fix field apiVersion is missing from events reported from taint manager
2023-08-21 07:03:23 -07:00
Patrick Ohly
2472291790 api: introduce separate VolumeResourceRequirements struct
PVC and containers shared the same ResourceRequirements struct to define their
API. When resource claims were added, that struct got extended, which
accidentally also changed the PVC API. To avoid such a mistake from happening
again, PVC now uses its own VolumeResourceRequirements struct.

The `Claims` field gets removed because risk of breaking someone is low:
theoretically, YAML files which have a claims field for volumes now
get rejected when validating against the OpenAPI. Such files
have never made sense and should be fixed.

Code that uses the struct definitions needs to be updated.
2023-08-21 15:31:28 +02: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
git-jxj
a5b3a4b738
cleanup: Update deprecated FromInt to FromInt32 (#119858)
* redo commit

* apply suggestions from liggitt

* update Parse function based on suggestions
2023-08-16 09:33:01 -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
Kubernetes Prow Robot
fa1fc7a9cb
Merge pull request #119904 from tenzen-y/replace-deprecated-workqueue-lib
Job: Replace deprecated workqueue function with supported one
2023-08-15 23:13:52 -07:00
Kubernetes Prow Robot
5638fe5f33
Merge pull request #119214 from kaisoz/refactor-controller-utils-test
Rewrite the tests to be table driven
2023-08-15 15:17:55 -07:00
Kubernetes Prow Robot
7407f36b4b
Merge pull request #117992 from liggitt/gc-discovery-flutter
Fix duplicate GC event handlers getting added if discovery flutters
2023-08-15 15:16:50 -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
Tomas Tormo
074d5b5329 Rewrite the tests to be table driven 2023-08-03 08:39:46 +00:00
Kubernetes Prow Robot
18f8cb8398
Merge pull request #118644 from alexzielenski/apiserver/policy/namespaceParamRef
KEP-3488: Promote ValidatingAdmissionPolicy to Beta
2023-07-21 17:44:08 -07:00
Alexander Zielenski
ef8670c946 refactor: replace usage of v1alpha1 with v1beta1
v1alpha -> v1beta

fill in DenyAction where there is no ParameterNotFoundAction
2023-07-21 13:41:24 -07:00
Kubernetes Prow Robot
a30f6b7922
Merge pull request #119506 from mimowo/fix-job-controller-flaky-test
Fix the flaky TestJobApiBackoffReset test
2023-07-21 09:30:07 -07:00
Michal Wozniak
dbea279112 Fix the flaky TestJobApiBackoffReset test 2023-07-21 14:45:04 +02: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
Kubernetes Prow Robot
88c8bcbb4a
Merge pull request #115952 from pacoxu/cleanup-cronjob
cronjob: return immediately when failed to create job for the namespace is terminating
2023-07-18 21:28:02 -07:00
Chok Yip Lau
dbaa9fe6b4 added podgc orphaned pod unit tests 2023-07-18 23:06:19 -04:00
Kubernetes Prow Robot
d1d86dafb7
Merge pull request #118772 from kannon92/terminating-pod-gc
KEP-3939: pod gc changes for pod replacement policy kep
2023-07-18 16:46:03 -07:00
Michał Woźniak
a15c27661e
Job controller implementation of backoff limit per index (#118009) 2023-07-18 13:44:11 -07:00
Daniel Vega-Myhre
7698fe7639
Add StatefulSet pod index as pod label (#119232)
* add statefulset pod index as pod label

* change statefulset pod index label name

* check 3 pods

* change label variable name
2023-07-17 12:47:10 -07:00
kannon92
e38ab6d367 Add PodGC changes for PodReplacementPolicy 2023-07-16 23:47:04 +00:00