Commit Graph

195 Commits

Author SHA1 Message Date
Ryan Phillips
230124f3d4 kubelet: add e2e test to verify probe readiness 2022-06-06 17:00:55 -05:00
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
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
be9ef536cd
Merge pull request #105995 from NoicFank/feature-add-error-handle
Add error handling for Write() function
2022-05-03 17:18:07 -07:00
Sergey Kanzhelev
1df526b3f7 remove TODOs from http package and prober 2022-04-28 16:51:11 +00:00
Dingzhu Lurong
1de2f3cc7d add writer error handler 2022-01-11 11:47:25 +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
Sergey Kanzhelev
a11453efbc remove ReallyCrashForTesting and cleaned up some references to HandleCrash behavior 2021-11-29 20:00:10 +00:00
Sergey Kanzhelev
b7affcced1 implement :grpc probe action 2021-11-17 17:31:23 +00:00
yxxhero
4211826c3c add more msg when exec probe timeout
Signed-off-by: yxxhero <aiopsclub@163.com>
2021-11-06 15:59:22 +08:00
Tim Hockin
11a25bfeb6
De-share the Handler struct in core API (#105979)
* De-share the Handler struct in core API

An upcoming PR adds a handler that only applies on one of these paths.
Having fields that don't work seems bad.

This never should have been shared.  Lifecycle hooks are like a "write"
while probes are more like a "read". HTTPGet and TCPSocket don't really
make sense as lifecycle hooks (but I can't take that back). When we add
gRPC, it is EXPLICITLY a health check (defined by gRPC) not an arbitrary
RPC - so a probe makes sense but a hook does not.

In the future I can also see adding lifecycle hooks that don't make
sense as probes.  E.g. 'sleep' is a common lifecycle request. The only
option is `exec`, which requires having a sleep binary in your image.

* Run update scripts
2021-10-29 13:15:11 -07:00
wojtekt
53ce79a18a Migrate to k8s.io/utils/clock in pkg/kubelet 2021-09-10 12:20:09 +02:00
Matthias Bertschy
3916c00955 fix manual trigger of readinessProbe on startupProbe success 2021-05-05 11:21:40 +02:00
Shiming Zhang
6defb3657f Fix startupProbe behaviour changed
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-16 10:11:52 +08:00
Shiming Zhang
44e9f6175d Fix test
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-14 17:02:27 +08:00
Elana Hashman
6af7eb6d49
Migrate missed log entries in kubelet
Co-Authored-By: pacoxu <paco.xu@daocloud.io>
2021-03-18 14:26:26 -07:00
Kubernetes Prow Robot
76b29c4cbb
Merge pull request #99830 from krzysiekg/structured_logging_pkg_kubelet_prober
Migrate pkg/kubelet/prober to structured logging
2021-03-16 14:49:13 -07:00
Kubernetes Prow Robot
11e9c32e4b
Merge pull request #97093 from aldudko/migrate-kubelet-logs
Migrate prober.probe logs to structured logging
2021-03-09 04:26:59 -08:00
Kubernetes Prow Robot
b48e7f1e7b
Merge pull request #99859 from krzysiekg/replace_klog_in_pkg_kubelet_tests
Replace klog with with testing.T logging in pkg/kubelet tests
2021-03-08 19:24:02 -08:00
Krzysztof Gibuła
e46b280f96 Replace klog with with testing.T logging in pkg/kubelet tests 2021-03-07 23:10:02 +01:00
Krzysztof Gibuła
86b0efcd77 Migrate pkg/kubelet/prober to structured logging 2021-03-05 16:10:09 +01:00
Matthias Bertschy
431e6a7044 Move readinessManager updates handling to kubelet 2021-03-05 07:02:25 +01:00
Matthias Bertschy
eed218a3a2 Move startupManager updates handling to kubelet 2021-03-05 07:02:25 +01:00
Matthias Bertschy
4870e64ac1 Improve update time of readiness state 2021-03-05 07:02:24 +01:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Matthias Bertschy
e2edd4a055 Stop probing a pod during graceful shutdown 2021-02-03 19:23:21 +01:00
Alex Dudko
088030a4d1 Migrate prober.probe logs to structured logging 2020-12-15 18:12:20 -08:00
Matthias Bertschy
ea14585500 Remove StartupProbe featuregate and related logic 2020-08-22 15:09:52 +02:00
Kubernetes Prow Robot
1e3eeba9fa
Merge pull request #91577 from knabben/kubelet-bootstrap
kubelet: remove the --bootstrap-checkpoint-path feature
2020-07-09 00:03:41 -07:00
Kubernetes Prow Robot
4ee555252c
Merge pull request #83710 from edwardstudy/ed/typo
Fix comment typos in pkg/kubelet/prober
2020-07-09 00:02:58 -07:00
Kubernetes Prow Robot
b0e974e1aa
Merge pull request #92239 from matthyx/more-tests
Add tests covering startup probe without readiness
2020-06-24 10:32:13 -07:00
Sergey Kanzhelev
ee53488f19 fix golint issues in pkg/kubelet/container 2020-06-19 15:48:08 +00:00
Matthias Bertschy
681202abd0 Add tests covering startup probe without readiness 2020-06-18 22:13:20 +02:00
Tim Hockin
64d4254217 Pods which have not "started" can not be "ready"
Before this commit, containers which have both a `startupProbe` and a
`readinessProbe` are marked as `ready=false` during stratup, but
containers which have only a `startupProbe` are marked `ready=true`.
This doesn't make sense.

This commit only considers readiness if the container is considered to
have "started", which leaves `ready=false` while starting up.
2020-06-16 21:34:51 -07:00
Amim Knabben
0ed41c3f10 Deprecating --bootstrap-checkpoint-path flag 2020-06-09 15:27:01 -04:00
Kubernetes Prow Robot
99c50dfd3c
Merge pull request #85225 from DataDog/eric.mountain/cleanup_refmanager_master
Removes container RefManager
2020-05-28 16:37:15 -07:00
Kubernetes Prow Robot
0e37bcce2c
Merge pull request #88385 from tallclair/node-reviews
Remove tallclair from some OWNERS files
2020-05-24 20:23:11 -07:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04: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
Ryan Phillips
348d9941b1 kubelet: tweak exec-probe log statement to be more concise 2020-05-13 11:42:43 -05:00
Tim Allclair
029a144ae9 Remove tallclair from some OWNERS files 2020-05-11 11:44:38 -07:00
Eric Mountain
22e0ee768b Removes container RefManager 2020-03-16 14:30:57 +01:00
Eric Mountain
4cb28f64ea Fixes for the No ref for container in probes after kubelet restart 2020-02-21 13:32:48 +01:00
Matthias Bertschy
66595d54a0 Add startupProbe result handling to kuberuntime 2019-11-13 08:12:54 +01:00
Zida
bc56cf45a5 Fix comment typos in prober 2019-10-10 14:53:08 +08:00
RainbowMango
f57bb81e95 Update bazel by hack/update-bazel.sh 2019-09-29 11:52:30 +08:00
RainbowMango
3b89ade154 Remove direct reference to Prometheus 2019-09-29 11:41:28 +08:00
Davanum Srinivas
5706a13bd6
Exec probes should not be unbounded
In 1f270ef4e2, we added 10KB as the read
limit for http probes. we should do the same for exec probes as well.

Change-Id: If154c5c4e669829ab94839c56260a894a6714f0f
2019-09-11 10:15:35 -04:00
Matthias Bertschy
a042a4b0ee startupProbe: make update 2019-08-30 00:42:43 +02:00