Commit Graph

32 Commits

Author SHA1 Message Date
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Ron Lai
038b8797c4 Calculating the disk usage based on available bytes instead of usage bytes to account for reserved blocks in image GC 2016-06-23 21:41:33 -07:00
Shaya Potter
ae08ef38d7 kubelet/cadvisor: Refactor cadvisor disk stat/usage interfaces 2016-05-19 11:13:47 -07:00
Andy Goldstein
f091ea5eda Handle image digests in node status and image GC
Start including Docker image digests in the node status and consider image digests during image
garbage collection.
2016-05-07 06:50:51 -04:00
zhouhaibing089
67747ca08f allow equality to avoid flaky on clock 2016-05-04 09:11:22 +08:00
mqliang
641ba92aa3 move minGCAge to ImageGCPolicy and make it configurable 2016-02-15 22:54:54 +08:00
Jan Chaloupka
4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
mqliang
c9f4f78273 reuse fake clock in the kube repo for kubelet unit tests 2016-01-26 23:42:00 +08:00
combk8s
5b383dad62 fix image gc bug 2016-01-15 16:43:22 +08:00
harry zhang
27ca7dc71e Expose image list in node status
Change image manager to use repotag
2016-01-08 17:01:31 +08:00
Jan Chaloupka
9590b23264 LowThresholdPercent can not be higher than HighThresholdPercent
if LowThresholdPercent > HighThresholdPercent, amountToFree at image_manager.go:208 is negative and image GC will not free memory properly.

Justification:

1) LowThresholdPercent > HighThresholdPercent implies (LowThresholdPercent * capacity / 100) > (HighThresholdPercent * capacity / 100)
2) usage is at least (HighThresholdPercent * capacity / 100)
3) amountToFree = usage - (LowThresholdPercent * capacity / 100)

Combining 1), 2) and 3) implies amountToFree can be negative.

What happens if amountToFree is negative? in freeSpace method, "for _, image := range images " loops at least once
and if everything goes fine, "delete(im.imageRecords, image.id)" is executed.
When checking for condition "if spaceFreed >= bytesToFree", it is always true as bytesToFree is negative
and spaceFreed is positive. The loop is finished, so is image GC.

At the end, only the oldest image is deleted. In situations where there is a lot of dead containers,
each container corresponing to distinct image, number of unused images can get higher.
If two new images get pulled in every 5 minutes, image GC will not work properly and will not free enough space.
Secondly, it will take a lot of time to free all unused images (hours depending on a number of unused images).

This is an incorrect configuration. Image GC should report it and refuse to work.
2015-12-02 14:28:51 +01:00
Avesh Agarwal
3d5207fd73 This commit adds type information to events.
This addresses issue #15624.
2015-11-24 09:59:54 -05:00
Vishnu kannan
129dbc734c avoid requiring runtime to be up while initializing kubelet image manager 2015-11-11 15:00:37 -08:00
jiangyaoguo
b0f0c294d9 make reasons constants with clarity 2015-11-09 23:42:14 +08:00
feisky
d25ae52d9b Refactor image manager for client/server implementation of the container runtime 2015-09-26 08:29:08 +08:00
Brian Grant
efd19143f7 Revert "Refactor image manager for client/server implementation of the container runtime" 2015-09-25 15:24:18 -07:00
feisky
f1124eb0b1 Refactor image manager to operate on Runtime 2015-09-17 23:02:00 +08:00
Daniel Smith
15b30b8b09 Move version agnostic parts of client
pkg/client/unversioned/cache -> pkg/client/cache
pkg/client/unversioned/record -> pkg/client/record
2015-09-10 17:17:59 -07:00
tummychow
78ce5da988 Move util.StringSet into its own package
A lot of packages use StringSet, but they don't use anything else from
the util package. Moving StringSet into another package will shrink
their dependency trees significantly.
2015-09-10 12:04:15 -07:00
caogaojin
60cb4406e9 Cleanup deprecated Forever function
Since util.Forever function has been deprecated, we should cleanup these
pieces of code.
2015-08-24 10:31:59 +08:00
Kris Rousey
ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
jiangyaoguo
9ab4a46b9d Keep event reason in kubelet consistent with others 2015-08-12 19:00:09 +08:00
Veres Lajos
9f77e49109 typofix - https://github.com/vlajos/misspell_fixer 2015-08-08 22:31:48 +01:00
Mike Danese
17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Victor Marmol
9f283f356f Start ImageManager housekeeping in Run().
Fixes #7762
Fixes #5634
2015-05-05 11:15:12 -07:00
Eric Paris
6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Xiang Li
2f2247dae3 pkg/kubelet: no more self receiver in kubelet pkg 2015-04-19 20:26:07 -07:00
Victor Marmol
de35c8f2af Record event when image GC fails. 2015-03-30 10:32:51 -07:00
Victor Marmol
d78ecf820e Garbage collecting images in the Kubelet.
Integrated the imageManager into the Kubelet and applies the garbage
collection policy every 5 minutes. The default policy allows up to 90%
disk usage, after which images are garbage collected to bring limit back
down to 80%.

Fixes #157.
2015-03-17 17:56:02 -07:00
Victor Marmol
6bcbf12a3d Add image garbage collection policy to imageManager. 2015-03-17 09:19:04 -07:00
Victor Marmol
4f3f073f3c Implementing ImageManager to take over image lifecycle.
All images are tracked, when they were created and when they were last
used. FreeSpace() evicts these images in least recently used order,
breaking ties with oldest first.
2015-03-06 10:48:28 -08:00