Commit Graph

5635 Commits

Author SHA1 Message Date
Konstantin Misyutin
4ba98a8610 cleanup: remove unnecessary import aliases 2022-03-16 15:43:09 +08:00
Konstantin Misyutin
1d7cefe9c4 Move volume helpers to "k8s.io/component-helpers/storage/volume".
This patch aims to simplify decoupling "pkg/scheduler/framework/plugins"
from internal "k8s.io/kubernetes" packages. More described in
issue #89930 and PR #102953.

Some helpers from "k8s.io/kubernetes/pkg/controller/volume/persistentvolume"
package moved to "k8s.io/component-helpers/storage/volume" package:

- IsDelayBindingMode
- GetBindVolumeToClaim
- IsVolumeBoundToClaim
- FindMatchingVolume
- CheckVolumeModeMismatches
- CheckAccessModes
- GetVolumeNodeAffinity

Also "CheckNodeAffinity" from "k8s.io/kubernetes/pkg/volume/util"
package moved to "k8s.io/component-helpers/storage/volume" package
to prevent diamond dependency conflict.

Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2022-03-16 15:43:09 +08:00
Kubernetes Prow Robot
02b1ec5b0b
Merge pull request #108485 from BigDarkClown/master
Make daemon.NodeShouldRunDaemonPod function public
2022-03-15 00:30:21 -07:00
Deepak Kinni
d37f14d0ae Support for in-tree PV Deletion protection finalizer
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
2022-03-10 21:37:43 -08:00
Bartłomiej Wróblewski
b2e2fb8d89 Make daemon.NodeShouldRunDaemonPod function public 2022-03-08 11:32:17 +00:00
Kubernetes Prow Robot
34a6a7ca11
Merge pull request #108316 from hyschumi/fix_unnecessary_handlecrash
endpointslice: remove unnecessary HandleCrash
2022-03-07 18:20:34 -08:00
Kubernetes Prow Robot
da23196df6
Merge pull request #108450 from tnqn/stop-setting-rv-in-endpoints
Stop publishing Pod ResourceVersion in Endpoints and EndpointSlice API
2022-03-04 17:23:04 -08:00
Kubernetes Prow Robot
88f9728339
Merge pull request #108309 from zshihang/token
no auto-generation of secret-based service account token
2022-03-02 06:19:15 -08:00
Quan Tian
906e6d4670 Stop publishing Pod ResourceVersion in Endpoints and EndpointSlice API
The field is not used anywhere and its value may be stale as Endpoints
and EndpointSlice won't be updated if there is only Pod ResourceVersion
change..
2022-03-02 22:12:35 +08:00
Kubernetes Prow Robot
0dc83fe696
Merge pull request #108078 from tnqn/endpoints-resync
Skip updating Endpoints if no relevant fields change
2022-03-01 23:23:13 -08:00
Kubernetes Prow Robot
66daef4aa7
Merge pull request #108167 from jfremy/fix-107973
Fix nodes volumesAttached status not being updated
2022-03-01 12:49:54 -08:00
Kubernetes Prow Robot
06e107081e
Merge pull request #104732 from mengjiao-liu/remove-flag-experimental-check-node-capabilities-before-mount
kubelet: Remove the deprecated flag `--experimental-check-node-capabilities-before-mount`
2022-02-24 07:56:30 -08:00
hyschumi
d8536122b9 endpointslice: remove unnecessary HandleCrash 2022-02-24 09:59:09 +08:00
Shihang Zhang
fb6c727fde no auto-generation of secret-based service account token 2022-02-23 14:17:30 -08:00
Kubernetes Prow Robot
343125cc6c
Merge pull request #107997 from d-honeybadger/fix-tracking-cronjob-owned-jobs
Fix cronjob status reconciliation when job template labels change
2022-02-23 07:14:18 -08:00
d-honeybadger
fb094dc44e cronjob_controllerv2: do not filter jobs to be reconciled by labels 2022-02-23 09:10:33 -05:00
Jean-Francois Remy
e83184568d Add unit tests
- actual_state_of_world_test.go: test the new method GetVolumesToReportAttachedForNode
  for an existing node and a non-existing node
- node_status_updater_test.go: test UpdateNodeStatuses and UpdateNodeStatuses in nominal
  case with 2 nodes getting one volume each. Test UpdateNodeStatuses with the first call
  to node.patch failing but the following one succeeding
- add comment in node_status_updater.go
- fix log line in reconciler.go
- rename variable in actual_state_of_world.go
2022-02-22 12:21:58 -08:00
Jean-Francois Remy
f1717baaaa Fix nodes volumesAttached status not updated
The UpdateNodeStatuses code stops too early in case there is
an error when calling updateNodeStatus. It will return immediately
which means any remaining node won't have its update status put back
to true.

Looking at the call sites for UpdateNodeStatuses, it appears this is
not the only issue. If the lister call fails with anything but a Not Found
error, it's silently ignored which is wrong in the detach path.
Also the reconciler detach path calls UpdateNodeStatuses but the real intent
is to only update the node currently processed in the loop and not proceed
with the detach call if there is an error updating that specifi node volumesAttached
property. With the current implementation, it will not proceed if there is
an error updating another node (which is not completely bad but not ideal) and
worse it will proceed if there is a lister error on that node which means the
node volumesAttached property won't have been updated.

To fix those issues, introduce the following changes:
- [node_status_updater] introduce UpdateNodeStatusForNode which does what
  UpdateNodeStatuses does but only for the provided node
- [node_status_updater] if the node lister call fails for anything but a Not
  Found error, we will return an error, not ignore it
- [node_status_updater] if the update of a node volumesAttached properties fails
  we continue processing the other nodes
- [actual_state_of_world] introduce GetVolumesToReportAttachedForNode which
  does what GetVolumesToReportAttached but for the node whose name is provided
  it returns a bool which indicates if the node in question needs an update as
  well as the volumesAttached list. It is used by UpdateNodeStatusForNode
- [actual_state_of_world] use write lock in updateNodeStatusUpdateNeeded, we're
  modifying the map content
- [reconciler] use UpdateNodeStatusForNode in the detach loop
2022-02-22 12:20:53 -08:00
Quan Tian
38966453ce Skip updating Endpoints and EndpointSlice if no relevant fields change
When comparing EndpointSubsets and Endpoints, we ignore the difference
in ResourceVersion of Pod to avoid unnecessary updates caused by Pod
updates that we don't care, e.g. annotation update.

Otherwise periodic Service resync would intensively update Endpoints or
EndpointSlice whose Pods have irrelevant change between two resyncs,
leading to delay in processing newly created Services. In a scale
cluster with thousands of such Endpoints, we observed 2 minutes of
delay when the resync happens.
2022-02-18 20:47:27 +08:00
Kubernetes Prow Robot
8a6439d2b1
Merge pull request #108129 from ahg-g/ahg-suspend
Graduate SuspendJob to GA
2022-02-17 19:36:23 -08:00
Abdullah Gharaibeh
b2d2ec9e76 Graduate SuspendJob to GA 2022-02-15 10:46:13 -05:00
Quan Tian
5bd9892c94 Fix incorrect parameters in EndpointsEqualBeyondHash 2022-02-15 21:30:28 +08:00
Kubernetes Prow Robot
dea5589b1b
Merge pull request #107701 from kinderyj/perf/new-logic-optimiz-for-DetermineVolumeAction
perf:logic-optimiz-for-DetermineVolumeAction
2022-02-14 10:59:45 -08:00
Antonio Ojea
60502c9b32 endpointslice: don't try to update topology cache if node informer error 2022-02-11 12:14:01 +01:00
Kubernetes Prow Robot
49dc226381
Merge pull request #108020 from tossmilestone/remove-tolerate-unready-ep-annotation
Remove tolerate-unready-endpoints annotation
2022-02-11 01:40:04 -08:00
Kubernetes Prow Robot
973e77ceb1
Merge pull request #102330 from tnqn/replicaset-optimization
Add controllerUID index to improve ReplicaSetController performance
2022-02-10 10:15:46 -08:00
Kubernetes Prow Robot
dd3a30fdbb
Merge pull request #106398 from shawnhanx/controller_utils
should omit comparison to bool constant in pkg/controller/controller_utils.go
2022-02-10 07:17:46 -08:00
He Xiaoxi
ae9f117387 Remove tolerate-unready-endpoints annotation
Remove `tolerate-unready-endpoints` annotation in Service deprecated

from 1.11, use `Service.spec.publishNotReadyAddresses` instead.

Signed-off-by: He Xiaoxi <tossmilestone@gmail.com>
2022-02-09 17:17:29 +08:00
ravisantoshgudimetla
65ff81757d Wire contexts to Disruption controllers 2022-02-04 10:32:04 -05:00
jlsong01
d66b3edd65 allocate a unique scheme for each test to fix concurrent usage issue 2022-02-02 15:22:59 +08:00
jlsong01
d281e25426 Optimize cronjob controller status updates 2022-01-27 17:09:47 +08:00
Kubernetes Prow Robot
876d4e0ab0
Merge pull request #107659 from jlsong01/readability_ut_cj_controller
readability enhancement for cj controller unit test
2022-01-26 21:12:49 -08:00
yujunwang
8f96600907 perf:logic-optimiz-for-DetermineVolumeAction 2022-01-22 23:45:29 +08:00
jlsong01
79d921e040 readability enhancement for cj controller unit test 2022-01-20 23:10:10 +08:00
Kubernetes Prow Robot
184daed0db
Merge pull request #107559 from liggitt/invalid-selectors
Handle invalid selectors properly
2022-01-19 14:49:31 -08:00
Kubernetes Prow Robot
9d41c13348
Merge pull request #107443 from mattcary/no-watch
Turn off informer for statefulset unit tests
2022-01-19 01:28:18 -08:00
Matthew Cary
f2861d7876 Turn off informer for statefulset unit tests
Change-Id: I353a2d5bd59963d5d2308eaf7d0e6f77d969fc25
2022-01-15 20:29:19 +00:00
Jordan Liggitt
c0af728f43 Handle invalid selectors properly 2022-01-14 12:11:02 -05:00
Wojciech Tyczyński
551790729f Remove selflink references in different testing-related files 2022-01-14 12:58:05 +01:00
Kubernetes Prow Robot
3bd422dc76
Merge pull request #107293 from dims/jan-1-owners-cleanup
Cleanup OWNERS files - Jan 2021 Week 1
2022-01-13 10:30:30 -08:00
Andrew Sy Kim
845d4a4304 add myself as approver to pkg/controller
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2022-01-12 19:33:02 -05:00
Patrick Ohly
9eaa2dc554 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.
2022-01-12 07:48:36 +01:00
Kubernetes Prow Robot
1f382b171e
Merge pull request #107080 from sivchari/fix-misspell
fix curent to current
2022-01-11 13:56:53 -08:00
Kubernetes Prow Robot
ccccd90bbc
Merge pull request #107389 from jlsong01/refine_comments_quota_monitor
refine comments of quota monitor
2022-01-10 13:34:25 -08:00
Davanum Srinivas
ba1f853b5a
Add mwielgus back
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 09:02:53 -05:00
Davanum Srinivas
9682b7248f
OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 08:14:29 -05:00
astraw99
a5a54754d5 refactor garbagecollection controllers to make forget impossible to forget 2022-01-09 15:19:10 +08:00
Kubernetes Prow Robot
3bebe8f6b5
Merge pull request #105264 from devincd/fix_typo
fix the log description
2022-01-06 17:40:29 -08:00
jlsong01
d6bf04d85f refine comments of quota monitor 2022-01-06 23:08:53 +08:00
Kubernetes Prow Robot
65378e7747
Merge pull request #102636 from charlesxsh/svcacct-ctrl-test
fix a potential deadlock
2022-01-05 21:12:27 -08:00