Commit Graph

226 Commits

Author SHA1 Message Date
Davanum Srinivas
0608e8be25
update bazel BUILD files
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-20 10:57:47 -04:00
Davanum Srinivas
5692926914
Move packages for slightly better UX for consumers
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-20 10:57:46 -04: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
Uzuku
302cda742a Handle nil pod in pod format 2020-03-20 15:30:44 +08:00
Kubernetes Prow Robot
52fb02fdbe
Merge pull request #87718 from wojtek-t/kubelet_not_watching_immutable_secret_configmaps
WatchBasedManager stops  watching immutable objects
2020-02-11 23:14:33 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
wojtekt
b11b7d354d WatchBasedManager stops watching immutable objects 2020-01-31 20:53:21 +01:00
danielqsj
19fe9f8d94 replace grpc.WithDialer which is deprecated 2019-12-26 17:46:59 +08:00
Jordan Liggitt
297570e06a hack/update-vendor.sh 2019-11-06 17:42:34 -05:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +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
Tim Allclair
20fc22f461
Add LimitWriter util 2019-09-11 09:52:28 -04:00
Kubernetes Prow Robot
08b67378d3
Merge pull request #81397 from ddebroy/win-socket
Support Kubelet PluginWatcher in Windows
2019-08-28 01:37:12 -07:00
Deep Debroy
1321c9115b Support PluginWatcher in Windows
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-08-27 16:24:38 -07:00
Tim Allclair
8a495cb5e4 Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
Tim Allclair
6510d26b6a Fix misc static check issues 2019-08-21 10:40:21 -07:00
caiweidong
92851d213a Use RWMutex in watchBasedManager 2019-08-13 13:09:21 +08:00
Kubernetes Prow Robot
46e58df837
Merge pull request #79578 from cezarsa/stable-node-images
kubelet: ensure stable order for images in node status
2019-08-10 08:59:12 -07:00
RainbowMango
0e0e1f7dab 1. Fix lint errors for the whole directory staging/src/k8s.io/client-go/tools/cache;
2. Remove staging/src/k8s.io/client-go/tools/cache from .golint_failures;
3. Fix some typo from comments.
2019-07-27 15:49:03 +08:00
Kubernetes Prow Robot
74f371ce48
Merge pull request #75260 from jsafrane/fix-secret-timeout-msg
Fix message of failed sync
2019-07-16 17:36:33 -07:00
Cezar Sa Espinola
d96c2f63e9
kubelet: ensure stable order for images in node status
By using the image ID as part of the sort function we ensure a stable
order even for images with the same size.
2019-07-01 11:23:24 -03:00
wojtekt
cba13eb9ad Autogenerate code 2019-06-29 15:26:09 +02:00
wojtekt
fd819f8fdc Move APIObjectVersioner 2019-06-28 21:16:49 +02:00
David Ashpole
80ed28b15b disable kubelet local endpoints on windows 2019-06-04 14:07:10 -07:00
Kubernetes Prow Robot
fc005789c1
Merge pull request #77274 from RenaudWasTaken/kubeletpodresources-beta
Graduate 3rd party device monitoring plugins to beta!
2019-05-31 10:58:26 -07:00
Tara Gu
5e18554442 Implement plugin manager - a controller that manages plugin registration/unregistration 2019-05-30 19:00:59 -04:00
Renaud Gaubert
a03d2d4d4e Fix improper cleanup when creating a unix socket 2019-05-30 13:21:37 -07:00
Mike Danese
531a50c776 simplify pluginwatcher closing 2019-05-14 18:55:13 -07:00
Kubernetes Prow Robot
032b4d39c6
Merge pull request #77304 from cwdsuzhou/fix_leak_when_stop_error
Bugfix: fix chan leak when stop error
2019-05-14 18:24:55 -07:00
caiweidong
a01f0b4e5e Bugfix: fix channel leak when stop error 2019-05-05 23:06:13 +08:00
Jan Safranek
96c41f8a1e Fix message of failed sync
From:
MountVolume.SetUp failed for volume "secret-prometheus-k8s-proxy" :
couldn't propagate object cache: timed out waiting for the condition

To:
MountVolume.SetUp failed for volume "secret-prometheus-k8s-proxy" : failed
to sync secret cache: timed out waiting for the condition
2019-04-30 13:05:07 +02:00
Kubernetes Prow Robot
16085784bc
Merge pull request #75110 from bertinatto/fix_race_watcher
Send events before adding watchers in traversePluginDir
2019-04-29 17:19:38 -07:00
Fabio Bertinatto
f56455753b Remove unnecessary in-line function 2019-04-23 22:24:33 +02:00
Fabio Bertinatto
817c9ca953 Process plugins found before the ones watched
Currently, the method `pluginwatcher.traversePluginDir` descends into
a directory adding filesystem watchers and creating synthetic `create`
events when it finds sockets files. However, a race condition might
happen when a recently-added watcher observes a `delete` event in a
socket file before `pluginwatcher.traversePlugindir` itself notices
this file.

This patch changes this behavior by registering watchers on
directories, enqueueing and processing `create` events from sockets
found, and only then processing the events from the registered watchers.
2019-04-23 22:24:33 +02:00
caiweidong
2fe823ba46 fix: use locked func to replace the raw one to avoid concurrent read 2019-04-23 21:00:13 +08:00
SataQiu
cd6828bae0 fix golint failures of pkg/kubelet/util 2019-04-22 15:23:07 +08:00
Robert Krawitz
022f7c2cd7 Clean up PR #71617 2019-04-08 10:34:40 -04:00
Janek Łukaszewicz
52913c59d1 Test with 2 pods, to make it more reliable. 2019-03-07 17:02:51 +01:00
wojtekt
6dce4d87a3 Fix secret/configmap management for terminated pods 2019-02-28 18:59:53 +01:00
Xiang Dai
36065c6dd7 delete all duplicate empty blanks
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-23 10:28:04 +08:00
Kubernetes Prow Robot
d61e878533
Merge pull request #73997 from xichengliudui/fixlintcode
Fix golint failures
2019-02-19 01:44:48 -08:00
xichengliudui
4c42d542dc Fix golint failures
update pull request

update pull request
2019-02-12 13:01:49 -05:00
xichengliudui
d1d54f81ec update pull request
update pull request
2019-02-12 12:13:19 -05:00
xichengliudui
5aa58efe07 Fix golint failures
update pull request
2019-02-12 07:14:57 -05:00
Kubernetes Prow Robot
ce19aad22b
Merge pull request #70527 from qingsenLi/git181101
remove repetitive word in annotation
2019-01-15 20:19:09 -08:00
David Ashpole
54e581930c fix node and kubelet start times 2018-12-05 15:07:52 -08:00
k8s-ci-robot
d0ac922996
Merge pull request #70440 from nikhita/add-license-headers
Add license header to non-generated proto files
2018-11-29 00:48:05 -08:00
Vladimir Vivien
e86bdc7989 Forces fsnotify CREATE and REMOVE to occur serially 2018-11-26 22:11:47 -05:00
saad-ali
8f666d9e41 Modify kubelet watcher to support old versions
Modify kubelet plugin watcher to support older CSI drivers that use an
the old plugins directory for socket registration.
Also modify CSI plugin registration to support multiple versions of CSI
registering with the same name.
2018-11-21 18:37:31 -08:00
Renaud Gaubert
1a3fbf1f13 Update e2e tests to include CSI 2018-11-17 01:52:57 +01:00
Renaud Gaubert
229418f261 Update pluginwatcher to ignore CSI metadata dir and non socket files 2018-11-17 01:51:00 +01:00
David Ashpole
630cb53f82 add kubelet grpc server for pod-resources service 2018-11-15 09:43:20 -08:00
Vladimir Vivien
f16d3c56f6 Kubelet plugin watcher update to v1 2018-11-14 05:46:27 -05:00
Davanum Srinivas
e558e291d1
s/glog/klog/ - keep up with master
Change-Id: I27ff0545bc456ed8c0900cfeb90555f9ab7ae235
2018-11-10 07:57:01 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Renaud Gaubert
11fef8ba3b Pluginwatcher should prevent kubelet from starting if we cannot watch the plugin root 2018-11-09 00:20:22 +00:00
Renaud Gaubert
3a467ff44b Pluginwatcher: log error when walking fs rather than fail 2018-11-08 23:22:07 +00:00
Renaud Gaubert
3f5039a2d1 Fix pluginwatcher panic on failed startup 2018-11-08 23:22:07 +00:00
k8s-ci-robot
3b66adb8bc
Merge pull request #68562 from RenaudWasTaken/pluginwatcher-doc
Update pluginwatcher doc
2018-11-01 17:31:29 -07:00
qingsenLi
3ac9b27b2a remove repetitive word in annotation 2018-11-02 00:54:41 +08:00
Nikhita Raghunath
6285db6576 Add license header to non-generated proto files 2018-10-30 22:29:07 +05:30
Pengfei Ni
053b71d5d2 Switch windows runtime endpoints to npipe 2018-10-22 21:28:36 +08:00
Joe Betz
4263c75211 Update etcd client to 3.3.9 2018-10-08 13:34:34 -07:00
Renaud Gaubert
79056292aa Update pluginwatcher doc 2018-09-24 15:11:21 +02:00
Renaud Gaubert
63436ab4a3 Renamed pluginwatcher README to README.md 2018-09-21 16:25:33 +02:00
fisherxu
89f3fa3d62 use dailcontext 2018-09-08 16:07:38 +08:00
Renaud Gaubert
29d225e90c Update pluginwatcher tests 2018-09-06 14:44:03 +02:00
Renaud Gaubert
4d18aa63cd Refactor pluginwatcher to use the new API 2018-09-06 14:42:21 +02:00
Renaud Gaubert
2eb91e89c0 Update the plugin watcher interface 2018-09-06 14:42:21 +02:00
chentao1596
ce3f5002dd Add unit tests for methods of pod's format 2018-07-17 15:37:13 +08:00
chentao1596
9319be121e Change the method name from PodsWithDeletiontimestamps to PodsWithDeletionTimestamps 2018-07-17 15:34:32 +08:00
hui luo
d04f596829 Add hierarchy support for plugin directory
it traverses and watch plugin directory and its sub directory recursively,
plugin socket file only need be unique within one directory,

- plugin socket directory
-    |
-    ---->sub directory 1
-    |              |
-    |              ----->  socket1,  socket2 ...
-    ----->sub directory 2
-                  |
-                  ------> socket1, socket2 ...

the design itself allow sub directory be anything,
but in practical, each plugin type could just use one sub directory.

four bonus changes added as below

1. extract example handler out from test, it is easier to read the code
with the seperation.

2. there are two variables here: "Watcher" and "watcher".
"Watcher" is the plugin watcher, and "watcher" is the fsnotify watcher.
so rename the "watcher" to "fsWatcher" to make code easier to
understand.

3. change RegisterCallbackFn() return value order, it is
conventional to return error last, after this change,
the pkg/volume/csi is compliance with golint, so remove it
from hack/.golint_failures

4. refactor errors handling at invokeRegistrationCallbackAtHandler()
to make error message more clear.
2018-06-25 17:32:18 -07:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton
a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Jeff Grafton
01f94051c8 Remove the go_default_library_protos filegroups using buildozer 2018-06-22 16:22:18 -07:00
vikaschoudhary16
3a2e3bcc70 Add probe based mechanism for kubelet plugin discovery 2018-05-29 12:00:37 -04:00
vikaschoudhary16
401bab3642 Auto-generated files 2018-05-29 12:00:37 -04:00
wojtekt
068844aeb1 WatchingSecretManager 2018-05-17 12:18:14 +02:00
wojtekt
de37da8532 Refactor cache based manager 2018-05-16 10:59:32 +02:00
Jordan Liggitt
3fafdb7001
Detect backsteps correctly in base path detection
Avoid false positives with atomic writer ..<timestamp> directories
2018-03-13 02:23:06 -04:00
Jan Safranek
5110db5087 Lock subPath volumes
Users must not be allowed to step outside the volume with subPath.
Therefore the final subPath directory must be "locked" somehow
and checked if it's inside volume.

On Windows, we lock the directories. On Linux, we bind-mount the final
subPath into /var/lib/kubelet/pods/<uid>/volume-subpaths/<container name>/<subPathName>,
it can't be changed to symlink user once it's bind-mounted.
2018-03-05 09:14:44 +01:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Di Xu
48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
Yu-Ju Hong
16e7c6ee17 Close the file before renaming in FileStore
Also change the unit test to use a real file system to detect errors
like this.
2017-11-03 10:24:49 -07:00
Kubernetes Submit Queue
dc35709eee
Merge pull request #54085 from yujuhong/checkpoint-pkg
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a file store utility package in kubelet

More and more components checkpoints (i.e., persist their states) in
kubelet. Refurbish and move the implementation in dockershim to a
utility package to improve code reusability.
2017-11-02 13:50:16 -07:00
Pengfei Ni
28f67736b7 Add fake remote runtime service 2017-10-27 15:16:53 +08:00
Yu-Ju Hong
4b5a3ee2e5 Address more comments 2017-10-25 10:07:32 -07:00
Yu-Ju Hong
5cbca87add Address comments, fix lint failures, and bazel complaints 2017-10-19 15:18:30 -07:00
Yu-Ju Hong
9f2e29f0f0 Update bazel file 2017-10-17 10:42:19 -07:00
Yu-Ju Hong
5169cc85cf Add a file store utility package in kubelet
More and more components checkpoints (i.e., persist their states) in
kubelet. Refurbish and move the implementation in dockershim to a
utility package to improve code reusability.
2017-10-17 10:36:33 -07:00
Clayton Coleman
5649f9a578 Move pkg/kubelet/util/csr into client-go
Everything else it depends on was already there, and now we have a
somewhat consistent code chain.
2017-10-16 16:05:48 +02:00
Clayton Coleman
b3a11aa635
Have the certificate manager decide if the server is healthy
Prevent a Kubelet from shutting down when the server isn't responding to
us but we cannot get a new certificate. This allows a cluster to coast
if the master is unresponsive or a node is partitioned and their client
cert expires.
2017-10-16 14:27:03 +02:00
Clayton Coleman
cbecf17727
cache.ListWatchUntil should return err.ErrWaitTimeout
Clients shouldn't have to know about watch.ErrWatchClosed, which is
typically a server side decision to close and always means "Timeout" in
this conetxt.
2017-10-16 14:27:03 +02:00
Clayton Coleman
c3bea24ab6
Collapse duplicate code into pkg/util/csr
There is no reason to duplicate this code into two places.
2017-10-16 14:27:03 +02:00
Clayton Coleman
de3d7d1881
If CSR is deleted, exit immediately
No point in waiting
2017-10-16 14:27:02 +02:00
Clayton Coleman
74a0abb699
An expired certificate is not compatible
If the certificate in the CSR is expired, it's no good to the code.
Error out with the correct message.
2017-10-16 14:27:02 +02:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
gmarek
0504cfbc25 Make metav1.(Micro)?Time functions take pointers 2017-08-17 11:24:28 +02:00