Commit Graph

524 Commits

Author SHA1 Message Date
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
da3d98277b
Merge pull request #111839 from ialidzhikov/cleanup/pkg-controller
pkg/controller: Replace deprecated func usage from the `k8s.io/utils/pointer` pkg
2022-12-09 15:42:37 -08: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
ialidzhikov
aede3fbf40 pkg/controller: Replace deprecated func usage from the k8s.io/utils/pointer pkg 2022-11-23 17:40:23 +02: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
Ravi Gudimetla
7397c029e8 Promote DS MaxSurge to GA 2022-07-18 07:54:59 -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
Kubernetes Prow Robot
c3e3f6cd4d
Merge pull request #107241 from houjun41544/20211228-ds
pointer usage error
2022-03-26 11:45:33 -07:00
Bartłomiej Wróblewski
b2e2fb8d89 Make daemon.NodeShouldRunDaemonPod function public 2022-03-08 11:32:17 +00: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
houjun
de6fc49a99 pointer usage error 2022-01-02 13:55:53 +08:00
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05: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
evertrain
9ceb226c06 Bugfix prevent daemon controller to adopt controller revisions of other namespaces 2021-11-02 00:14:26 +08:00
Shuanglu
9bcfa71e31
Fix Daemonset controller role missing 'update pod' permission (#104758)
* fix_dsc_rbac_pod_update

* add test for DaemonSet Controller updates label of the pod after "DedupCurHistories"

* rebase

* update parameter of dsc.Run
2021-10-28 05:24:26 -07:00
Mike Dame
41fcb95f2f Wire contexts to Apps controllers 2021-10-13 16:32:13 -04:00
wojtekt
e233feb99b Migrate to k8s.io/utils/clock in pkg/controller 2021-09-10 11:42:32 +02:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Raymonder jin
03f9f75e88
fix typo for daemon_controller_test.go 2021-06-28 04:54:09 -07: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
9558d0c5c2
Merge pull request #101984 from ravisantoshgudimetla/fix-ds-units
[daemonSet]: Fix unit tests
2021-05-18 23:32:51 -07: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
ravisantoshgudimetla
20f8654259 [daemonSet]: Fix unit tests
We need to ensure that `DaemonSetUpdateSurge`
featuregate is both enabled and disabled when
running tests with Rolling update strategy.
2021-05-13 10:31:28 -04:00
Kubernetes Prow Robot
22d120b4d6
Merge pull request #101156 from alculquicondor/unused_create_pod
Remove unused CreatePodsOnNode function
2021-05-12 10:41:28 -07:00
ravisantoshgudimetla
6f35e1aea0 Run unit test with DSMaxSurgeFlag enabled and disabled 2021-05-10 16:33:09 -04:00
ravisantoshgudimetla
ceeb05a3d7 DaemonSet: Fix surgeCount function
If the surge is not requested, we should return
0. We are returning an error now as r.MaxSurge
is passed down as nil. This commit fixes the
issue by setting the surgeCount to 0 if r.MaxSurge
is nil.
2021-05-10 16:10:59 -04: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
Aldo Culquicondor
6fc5fc0c86 Remove unused CreatePodsOnNode function
Remnant of old daemonset controller
2021-04-15 18:53:36 +00: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
9f296c133d
daemonset: Simplify the logic for calculating unavailable pods
In order to maintain the correct invariants, the existing maxUnavailable
logic calculated the same data several times in different ways. Leverage
the simpler structure from maxSurge and calculate pod availability only
once, as well as perform only a single pass over all the pods in the
daemonset. This changed no behavior of the current controller, and
has a structure that is almost identical to maxSurge.
2021-03-01 13:23:16 -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
Clayton Coleman
8e6f58b0bd
daemonset: Prevent accidental omissions of test condition checks
It is too easy to omit checking the return value for the
syncAndValidateDaemonSet test in large suites. Switch the method
type to be a test helper and fatal/error directly. Also rename
a method that referenced the old name 'Rollback' instead of
'RollingUpdate'.
2021-03-01 13:20:58 -05:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
xiaofei.sun
fd62f32125 Scheduler: remove pkg/apis/core/field_constants.go 2021-02-24 18:06:29 +08: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
1a66eb7b8a
Merge pull request #89482 from renatoviana12/master
fixed percentage behaviour in instr
2020-10-05 20:00:19 -07:00
Renato Viana
316eff8dee Fixed percentage behavior in instr
fixed syntax, wrote a test

fixed a test

.

1

Update staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr_test.go

Co-Authored-By: Joel Speed <Joel.speed@hotmail.co.uk>

added test

.

fix

fix test

fixed a test

gofmt

lint

fix

function name

validation fix

.

godocs added

.
2020-09-30 21:23:05 +01:00
knight42
e89e72b637
test: ensure WaitForCacheSync is called after starting sharedInformerFacotry
Signed-off-by: knight42 <anonymousknight96@gmail.com>
2020-09-15 16:02:35 +08:00
Jordan Liggitt
8e6a8669c0 Deflake TestExpectationsOnRecreate 2020-07-31 18:12:01 -04:00