Commit Graph

134 Commits

Author SHA1 Message Date
Michal Wozniak
b5dd5f1f3a Investigate and fix the handling of Succeeded pods in DaemonSet 2023-04-04 19:21:15 +02:00
mantuliu
0567c93b2a Improve the performance of map usage
Signed-off-by: mantuliu <240951888@qq.com>
2023-03-21 20:37:53 +08:00
Patrick Ohly
99151c39b7 kube-controller-manager: convert to structured logging
Most of the individual controllers were already converted earlier. Some log
calls were missed or added and then not updated during a rebase. Some of those
get updated here to fill those gaps.

Adding of the name to the logger used by each controller gets
consolidated in this commit. By using the name under which the
controller is registered we ensure that the names in the log
are consistent.
2023-03-14 19:16:32 +01:00
ZhangKe10140699
7198bcffcd daemonset: use contextual logging 2023-03-14 08:50:27 +08:00
Gunju Kim
69fcde750a
Update daemonSet status even if syncDaemonSet fails
This ensures that the daemonset controller updates daemonset statuses in
a best-effort manner even if syncDaemonSet fails.

In order to add an integration test, this also replaces
`cmd/kube-apiserver/app/testing.StartTestServer` with
`test/integration/framework.StartTestServer` and adds
`setupWithServerSetup` to configure the admission control of the
apiserver.
2022-12-10 11:45:56 +09:00
Kubernetes Prow Robot
5fe12aae11
Merge pull request #111207 from lucming/code-cleanup2
Reduce indentation in daemonset controller code
2022-12-09 15:41:41 -08:00
Maciej Szulik
3c93d540c6
Revert "Update daemonSet status even if syncDaemonSet fails"
This reverts commit 2ee024a4df.
2022-11-08 15:01:09 +01:00
Kubernetes Prow Robot
b4f42864f5
Merge pull request #112127 from gjkim42/update-status-despite-error
Update daemonSet status even if syncDaemonSet fails
2022-11-07 16:00:28 -08:00
Kubernetes Prow Robot
20ffe3bbf9
Merge pull request #111607 from tnqn/reduce-redundant-index
Remove duplicate and unused index from PodIndexer
2022-11-04 09:36:16 -07:00
Han Kang
2bbd445f50 remove rate limiter metric as it is not in use
Change-Id: I91157653e3860eeecc3f572aee88da6ffc65faed
2022-10-13 13:07:11 -07:00
Gunju Kim
2ee024a4df
Update daemonSet status even if syncDaemonSet fails 2022-10-11 22:55:50 +09:00
Quan Tian
f40067a8cc Remove duplicate and unused index from PodIndexer
DaemonSetsController adds a "nodeName" index to PodIndexer, which is
redundant with the "spec.nodeName" index of NodeLifecycleController.
However, DaemonSetsController hasn't been using this index since #86730.
This patch removes the redundant and unused index to reduce memory and
CPU spent on it.

Signed-off-by: Quan Tian <qtian@vmware.com>
2022-08-02 10:53:54 +08:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
lucming
fba637c33d code clean up 2022-07-18 16:06:20 +08:00
Wojciech Tyczyński
11b679c66a Fix event broadcaster shutdown in multiple controllers 2022-05-17 22:14:19 +02:00
Bartłomiej Wróblewski
b2e2fb8d89 Make daemon.NodeShouldRunDaemonPod function public 2022-03-08 11:32:17 +00:00
Mike Dame
80c01707e0
Wire contexts to Batch controllers (#105491)
* Wire contexts to Batch controllers

* (hold) feedback + updates that overlap with Apps controllers

* fixup errors
2021-11-10 14:56:46 -08:00
Mike Dame
41fcb95f2f Wire contexts to Apps controllers 2021-10-13 16:32:13 -04:00
Aldo Culquicondor
d8aad7944c Remove unused util CreatePods
And rename CreatePodsWithControllerRef to simply CreatePods
2021-05-20 20:27:21 +00:00
Kubernetes Prow Robot
89e0b2d185
Merge pull request #99398 from tnqn/ds-update-retry
Fix DaemonSet status update retry
2021-05-18 22:32:50 -07:00
Kubernetes Prow Robot
5779fec3c4
Merge pull request #99959 from AliceZhang2016/nodeaffinity-cleanup
Move nodeaffinity helpers to component-helpers package
2021-04-21 17:03:53 -07:00
Kubernetes Prow Robot
e7dc0df323
Merge pull request #97650 from ialidzhikov/cleanup/redundant-imports
Clean up some redundant imports
2021-04-08 14:27:22 -07:00
Mengxue Zhang
bdda9728e7 move nodeaffinity helpers to component-helpers package 2021-03-10 20:19:25 +00:00
Quan Tian
60bb2a3a6f Fix DaemonSet status update retry
It's easy to get update conflict when processing a DaemonSet
continuously. storeDaemonSetStatus had a retry logic that it gets the
resource from apiserver to update the DaemonSet with the latest resource
version. However, it never really retried because of a wrong check and
always made an useless get call. This patch fixes the logic to allow
the function retry once on update error.
2021-03-09 00:39:25 +08:00
Clayton Coleman
8d8884a907
daemonset: Remove unnecessary error returns in strategy code
The nodeShouldRunDaemonPod method does not need to return an error
because there are no scenarios under which it fails. Remove the
error return path for its direct calls as well.
2021-03-01 13:23:18 -05:00
Clayton Coleman
18f43e4120
daemonset: Implement MaxSurge on daemonset update
If MaxSurge is set, the controller will attempt to double up nodes
up to the allowed limit with a new pod, and then when the most recent
(by hash) pod is ready, trigger deletion on the old pod. If the old
pod goes unready before the new pod is ready, the old pod is immediately
deleted. If an old pod goes unready before a new pod is placed on that
node, a new pod is immediately added for that node even past the MaxSurge
limit.

The backoff clock is used consistently throughout the daemonset controller
as an injectable clock for the purposes of testing.
2021-03-01 13:21:12 -05:00
Mike Dame
578ff3ec34 Move Taint/Toleration helpers to component-helpers repo
This is part of the goal for scheduling to remove dependencies on internal
packages for the scheduling framework. It also provides these functions in an
external location for other components and projects to import.
2021-02-01 11:06:03 -05:00
ialidzhikov
1b74f28ed8 Clean up some redundant imports
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>
2021-01-02 01:09:22 +02: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
Tomas Nozicka
5cf3f8b79c Fix DS expectations on recreate 2020-06-17 09:22:17 +02: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
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
Abdullah Gharaibeh
bed9b2f23b Cleanup obsolete NodeInfo methods 2020-04-12 18:13:46 -04:00
Kubernetes Prow Robot
62dc3ea6d1
Merge pull request #87368 from 928234269/fix_staticcheck01
fix staticcheck errors in pkg/controller/daemon.
2020-03-03 12:15:28 -08: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
Sakura
203c7b4731
fix staticcheck errors in pkg/controller/daemon.
Signed-off-by: Sakura <longfei.shang@daocloud.io>
2020-01-19 21:09:05 +08:00
Abdullah Gharaibeh
041e5b5560 addressed comments 2020-01-04 01:14:24 -05:00
Abdullah Gharaibeh
7d604c318c Break DS controller on scheduler predicates and predicate errors 2020-01-03 13:05:07 -05:00
Kubernetes Prow Robot
f67d3b1a7d
Merge pull request #86229 from ahg-g/ahg-ds
Remove daemonset controller's dependency on scheduler metadata
2019-12-13 00:26:54 -08:00
Abdullah Gharaibeh
288609ecf5 remove ds dependeny on scheduler metadata 2019-12-12 19:04:36 -05:00
Ted Yu
9cff345770 Do not swallow timeout in manageReplicas 2019-12-12 11:27:36 -08:00
Aldo Culquicondor
6a98c93f3c Add MetadataProducerFactory for predicates
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-11-11 11:27:44 -05:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Kubernetes Prow Robot
6a19261e96
Merge pull request #84123 from smarterclayton/terminating_cause
Handle namespace deletion more gracefully in built-in controllers
2019-11-04 07:55:41 -08:00
draveness
dc437a7890 feat: remove suspendedDaemonPods from daemon controller 2019-10-25 09:16:48 +08:00
draveness
35d772e354 feat: graduate ScheduleDaemonSetPods to GA 2019-10-23 21:34:47 +08:00
Clayton Coleman
8f74c8970b
daemonset: Ignore namespace termination errors when creating pods
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 daemon sets,
we should wait for more evidence that is an issue before changing
that logic substantially.
2019-10-20 18:39:00 -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