Commit Graph

44623 Commits

Author SHA1 Message Date
Ryan Phillips
f25ca15e1c kubelet: only shutdown probes for pods that are terminated
This fixes a bug where terminating pods would not run their readiness
probes. Terminating pods are found within the possiblyRunningPods map.
2022-06-06 17:00:54 -05:00
Clayton Coleman
1d518adb76 kubelet: Pod probes should be handled by pod worker
The pod worker is the owner of when a container is running or not,
and the start and stop of the probes for a given pod should be
handled during the pod sync loop. This ensures that probes do not
continue running even after eviction.

Because the pod semantics allow lifecycle probes to shorten grace
period, the probe is removed after the containers in a pod are
terminated successfully. As an optimization, if the pod will have
a very short grace period (0 or 1 seconds) we stop the probes
immediately to reduce resource usage during eviction slightly.

After this change, the probe manager is only called by the pod
worker or by the reconcile loop.
2022-06-06 17:00:54 -05:00
Kubernetes Prow Robot
1f90b7980b
Merge pull request #108997 from dobsonj/issue79980
Fix volume reconstruction for CSI ephemeral volumes
2022-06-03 18:08:20 -07:00
Kubernetes Prow Robot
60902b7caf
Merge pull request #109692 from yxxhero/remove_ioutil_in_kubelet
remove ioutil in kubelet
2022-06-03 09:30:51 -07:00
Kubernetes Prow Robot
ccfac6d320
Merge pull request #110360 from 21kyu/fix_defer_in_for_loop_listwatch_test
fix defer in for loop, maybe resource leak
2022-06-02 22:38:19 -07:00
Kubernetes Prow Robot
9f82d81e55
Merge pull request #110286 from FillZpp/add-test-for-statefulset-maxunavailable
A calculation function for StatefulSet maxUnavailable and some tests for it
2022-06-02 10:46:07 -07:00
21kyu
3f7dfc9818 fix defer in for loop, maybe resource leak 2022-06-03 02:08:23 +09:00
Kubernetes Prow Robot
03d0e2c338
Merge pull request #110264 from wojtek-t/fix_leaking_goroutines_4
Fix leaking goroutines in multiple integration tests
2022-06-02 03:59:47 -07:00
Kubernetes Prow Robot
901434942c
Merge pull request #107878 from danwinship/apiserver-endpointslice-cleanup
Clean up some EndpointSlice-related code in apiserver endpoint reconciler
2022-06-01 17:55:45 -07:00
Kubernetes Prow Robot
cb0e460343
Merge pull request #107872 from danwinship/apiserver-extra-ports
Remove unused and un-enable-able apiserver multiple ports feature
2022-06-01 15:49:58 -07:00
Kubernetes Prow Robot
a1b81ca06a
Merge pull request #101997 from shawnhanx/pvcquota
Add unit tests for pvc quota
2022-06-01 15:49:46 -07:00
Kubernetes Prow Robot
ffcbe6c7d7
Merge pull request #108974 from ArangoGutierrez/devel/typos/windows
Fix typo at pkg/windows/service/service.go:94
2022-06-01 13:39:58 -07:00
Jonathan Dobson
daa181d92e kubelet: fix volume reconstruction for CSI ephemeral volumes
This resolves a couple of issues for CSI volume reconstruction.
1. IsLikelyNotMountPoint is known not to work for bind mounts and was
   causing problems for subpaths and hostpath volumes.
2. Inline volumes were failing reconstruction due to calling
   GetVolumeName, which only works when there is a PV spec.
2022-06-01 14:22:57 -06:00
Kubernetes Prow Robot
737f706b1c
Merge pull request #108803 from SergeyKanzhelev/httpProbeMinorCleanup
remove TODOs from http package and prober
2022-06-01 12:03:28 -07:00
Kubernetes Prow Robot
22fda4e7ee
Merge pull request #108232 from qmloong/qmloong/chore
fix: remove the redundant count variable
2022-06-01 10:53:40 -07:00
Kubernetes Prow Robot
78fb1fa9a2
Merge pull request #109938 from dims/move-from-k8s.gcr.io-to-registry.k8s.io
Move from k8s.gcr.io to registry.k8s.io
2022-05-31 13:45:23 -07:00
Davanum Srinivas
50bea1dad8
Move from k8s.gcr.io to registry.k8s.io
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-05-31 10:16:53 -04:00
FillZpp
1818a9a36a A calculation function for StatefulSet maxUnavailable and some tests for it
Signed-off-by: FillZpp <FillZpp.pub@gmail.com>
2022-05-31 16:45:19 +08:00
kerthcet
186470abd4 Cleanup: modify unmatch comments with stopCh
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-05-31 11:28:02 +08:00
Wojciech Tyczyński
c20f7cc4e1 Clean shutdown of endpoints/endpointslice integration tests 2022-05-30 20:17:35 +02:00
Kubernetes Prow Robot
dfefd5a698
Merge pull request #110244 from humblec/feature-gate
CSINodeExpandSecret featuregate has to be 1.25 based
2022-05-28 03:06:50 -07:00
Kubernetes Prow Robot
8b6dd065d7
Merge pull request #110255 from robscott/fix-pod-eviction-ip
Endpoints and EndpointSlices should not publish IPs for terminal pods
2022-05-27 16:24:42 -07:00
Rob Scott
aa02b7a434
Updating e2e test to check EndpointSlices and Endpoints as well 2022-05-27 21:10:59 +00:00
Dan Winship
c44f5467a2 Remove unused and un-enable-able apiserver multiple ports feature
Theoretically, the apiserver could be told to advertise additional
ports on the kubernetes service, but there was no way to enable this
functionality without forking/vendoring the apiserver code. This was
apparently added in the distant past for OpenShift to use, but it has
not been used in OpenShift since Kubernetes 1.11.
2022-05-27 08:46:44 -04:00
Dan Winship
80e9d948e3 Add more Endpoints vs EndpointsSlices reconciler tests 2022-05-27 08:46:24 -04:00
Dan Winship
07de59ab60 Remove unused endpointSlicesEnabled fields 2022-05-27 08:46:23 -04:00
Dan Winship
91338c13df Use EndpointSlices in all reconciler unit tests
EndpointSlice is always enabled now, so make it non-optional in the
EndpointsAdapter, make all of the test cases pass an EndpointSlice
client, and remove the "EndpointSlices disabled"-specific tests.

By changing makeEndpointsArray() to return both an Endpoints and an
EndpointsSlice, the "initialObjects" and "expectCreate"/"expectUpdate"
fields of (almost) all of the existing unit tests are automatically
switched to be EndpointSlice-aware; instead of having an initial state
with just Endpoints (or nothing), and testing that just the Endpoints
is created/updated correctly, they now have an initial state with both
Endpoints and EndpointSlice (or nothing), and test that both objects
are created/updated correctly.

The handful of existing test cases that used inconsistent Endpoints
and EndpointSlice state have been modified to create the objects
separately.
2022-05-27 08:46:23 -04:00
Dan Winship
f543e7434a Improve reconciler test result checking
Consistently verify creates/updates based on the fake client's action
tracking, not based on the return values of the reconciler functions.
(This will also let us check that both Endpoints and EndpointSlices
were created/updated correctly.)
2022-05-27 08:46:23 -04:00
Dan Winship
4033de2034 Simplify endpoint creation in reconciler unit tests
Also make the expectCreate / expectUpdate fields into arrays while
we're rewriting their values anyway, to avoid additional churn in the
next commit.
2022-05-27 08:46:23 -04:00
Dan Winship
b07fe3a974 Simplify reconciler unit test setup
Pass initial state objects to fake.NewSimpleClientSet() rather than
calling Create() by hand.

(This will make it easier to have an initial state that is a mix of
Endpoints and EndpointSlices later on.)
2022-05-27 08:46:23 -04:00
Dan Winship
007ca4f69d Use t.Run() consistently in reconciler unit tests 2022-05-27 08:46:23 -04:00
Kubernetes Prow Robot
ad06854e5e
Merge pull request #110228 from mysunshine92/HPA-log-optimization
Error message optimization for podautoscaler controller
2022-05-27 05:13:18 -07:00
Kubernetes Prow Robot
40543b77b5
Merge pull request #110183 from lokichoggio/doc
complete doc
2022-05-27 05:13:07 -07:00
Kubernetes Prow Robot
cb92b2c119
Merge pull request #110203 from wppzxc/add-testcases
Fix: Add test cases for method IsZeroCIDR() in  pkg/proxy/util/utils_test.go
2022-05-27 00:41:08 -07:00
Antonio Ojea
aa35f6f160 endpoints controller: don't consider terminal endpoints
Terminal pods, whose phase its Failed or Succeeded, are guaranteed
to never regress and to be stopped, so their IPs never should
be published on the Endpoints.
2022-05-27 06:42:58 +02:00
Antonio Ojea
b905c2870b endpointslices: terminal pods doesn't receive enpoints 2022-05-27 06:42:52 +02:00
Antonio Ojea
d16d23e0c7 add pod util to verify pod is terminal
pods on phase succeeded or failed are guaranteed to have all containers
stopped and to not ever regress
2022-05-27 06:42:39 +02:00
Humble Chirammal
055512b5c8 CSINodeExpandSecret featuregate has to be 1.25 based
At present the CSINodeExpandSecret feature gate has been tagged with
1.24 in the source code comments incorrectly. This commit address
the same

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-05-27 10:07:55 +05:30
Kubernetes Prow Robot
32c3fb3b78
Merge pull request #110227 from aojea/cleanup
Cleanup feature gate check for SelectorIndex
2022-05-26 14:09:55 -07:00
Dan Winship
217f720c72 Fix up some kubernetes service reconciling code organization.
When the endpoint reconcilers got split out of pkg/controlplane,
GetMasterServiceUpdateIfNeeded() got moved to
pkg/controlplane/reconcilers, even though it needs to be kept in sync
with CreateOrUpdateMasterServiceIfNeeded() which stayed in
pkg/controlplane. (And everything else in pkg/controlplane/reconcilers
is about the Endpoints not the Service anyway.) So move it back.

On the flip side, the implementation of masterCountEndpointReconciler
got moved to pkg/controlplane/reconcilers, but its unit tests didn't.
So belatedly fix that.
2022-05-26 13:39:54 -04:00
Kubernetes Prow Robot
4a2391caf3
Merge pull request #108259 from carlosdamazio/refactor/roundrobin
pkg/proxy/userspace/roundrobin: Make `lb.services` nil check standardized
2022-05-26 08:45:23 -07:00
wangyamei
187dcb5a59 Error message optimization for podautoscaler controller 2022-05-26 23:40:34 +08:00
Antonio Ojea
410aaaa202 cleanup: remove check for GA feature gate 2022-05-26 13:26:49 +02:00
Wojciech Tyczyński
fe3616cafb Clean shutdown of kcm, ccm and scheduler 2022-05-26 12:36:59 +02:00
Kubernetes Prow Robot
68fc207cd9
Merge pull request #110027 from zlabjp/fix-ipallocator-metrics
Fix cluster IP allocator metrics
2022-05-25 11:48:31 -07:00
wupengpeng
872be44775 Fix: Add test cases for method IsZeroCIDR() in pkg/proxy/util/utils_test.go 2022-05-25 10:47:33 +08:00
Kubernetes Prow Robot
d5579bf778
Merge pull request #109424 from gkarthiks/master
Refactor kube-proxy internal naming for Service Port Name string
2022-05-24 18:42:43 -07:00
areller
a6943ad863
[fix] fix and refactor TestValidateStatefulSet and TestValidateStatefulSet test cases (#109809)
* restructure tests

restructure TestValidateStatefulSet and TestValidateStatefulSetUpdate to be an array and accept list of expected errors. in this commits, no tests were changed and expected errors are not filled yet

* add expected errors

adding expected errors and making the tests pass, without making any changes to the tests

* clean up TestValidateStatefulSet error cases

* clean up TestValidateStatefulSetUpdate cases

* validate new statefulset as part of update validation

* address PR comments
2022-05-24 11:55:24 -07:00
lokichoggio
57d1c2d5cd
complete doc 2022-05-24 11:26:15 +08:00
Kubernetes Prow Robot
aa49dffc7f
Merge pull request #110148 from wojtek-t/metrics_recorder_shutdown
Clear shutdown of scheduler metrics recorder
2022-05-23 07:18:15 -07:00