Commit Graph

52 Commits

Author SHA1 Message Date
Sascha Grunert
e663285ccf
Add image_id to CRI Container message
This new field allows fixing the kubelet image garbage collection in
container runtimes. The `image_ref` has been historically used by
container runtimes to reference images by digest.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-02-28 10:05:07 +01:00
Kubernetes Prow Robot
d311ce0435
Merge pull request #123343 from haircommander/image-gc-e2e-2
KEP-4210: add e2e tests and add small fix for ImageGCMaxAge
2024-02-20 10:48:15 -08:00
Peter Hunt
a8ea936364 image gc: don't start until max age has passed since kubelet started
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-02-19 14:44:20 -05:00
Peter Hunt
c8b4d8ebed kubelet: add reason field to image gc metric
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2024-02-16 16:02:41 -05:00
Kubernetes Prow Robot
c3114b2789
Merge pull request #119652 from lixd/kubelet_image_gc
fix kubelet image gc
2023-11-13 17:36:15 +01:00
Kevin Hannon
26923b91e8 implementation of split disk kep 2023-11-01 14:46:33 -04:00
kiashok
252e1d2dfe Imagepull per runtime class alpha release changes
This commit does the following:
1. Add RuntimeClassInImageCriApi feature gate
2. Extend pkg/kubelet/container Image struct
3. Adds runtimeHandler string in the following CRI calls
   i.   ImageStatus
   ii.  PullImageRequest
   iii.  RemoveImage

Signed-off-by: kiashok <kiashok@microsoft.com>
2023-10-31 15:52:46 -07:00
Peter Hunt
49c947ba15 metrics: add and use ImageGarbageCollectedTotal
to help find MaxAge thresholds and detect image addition/removal thrashing

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2023-10-20 12:23:31 -04:00
Peter Hunt
914aa746c1 kubelet/images: add and use freeOldImages function
to free images older than configured ImageGCMaximumAge

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2023-10-20 12:23:31 -04:00
Peter Hunt
d992ea4b30 kubelet: add and use ImageMaximumGCAge in KubeletConfiguration
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2023-10-20 12:23:31 -04:00
Peter Hunt
e22ebf13a9 kubelet/images: refactor freeImage and imagesInEvictionOrder
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2023-10-16 16:34:29 -04:00
lixd
bad0593a68 fix kubelet image gc
Signed-off-by: lixd <xueduan.li@gmail.com>
2023-09-19 15:48:59 +08:00
Sohan Kunkerkar
d5690f12b6 pkg/kubelet: allow sandbox image pinning from CRI
As part of this change, the code responsible for managing the sandbox
image within the kubelet has been removed. Previously, the kubelet used
to prevent sandbox image from the garbage collection process. However,
with this update, the responsibility of managing the sandbox containers
has been shifted to the CRI implementation itself. By allowing sandbox
image pinning from CRI, we improve efficiency and simplify the kubelet's
interaction with the container runtime. As a result, the kubelet can now
rely on the container runtime's built-in mechanisms for sandbox container
lifecycle management.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2023-08-29 15:34:51 -04:00
Vadim Rutkovsky
556d774945 kubelet: create top-level traces for pod sync and GC
This starts new top level OpenTelemetry spans every time syncPod or image / container GC is invoked
2023-03-11 10:42:14 +01:00
David Ashpole
64af1adace
Second attempt: Plumb context to Kubelet CRI calls (#113591)
* plumb context from CRI calls through kubelet

* clean up extra timeouts

* try fixing incorrectly cancelled context
2022-11-05 06:02:13 -07:00
Antonio Ojea
9c2b333925 Revert "plumb context from CRI calls through kubelet"
This reverts commit f43b4f1b95.
2022-11-02 13:37:23 +00:00
David Ashpole
f43b4f1b95
plumb context from CRI calls through kubelet 2022-10-28 02:55:28 +00:00
Todd Neal
9e83c2d7eb reword image gc failure log
Reword the log so that it sounds less like a failure of kubelet and points
towards the root cause of not enough data being eligible to free.
2022-09-20 21:57:59 -05:00
Skyler Clark
e9766c2b81
adds pinned field to imageRecords 2021-11-03 14:47:37 -04:00
Skyler Clark
d3ae0a381a
prevents garbage collection from removing pinned images 2021-11-02 14:43:02 -04:00
Elana Hashman
10976cbb43
Migrate image_gc_manager.go to structured logs 2021-03-15 12:39:42 -07:00
Marek Siarkowicz
7d309e0104 Move Kubelet Summary API to staging repo 2020-09-22 18:23:28 +02:00
Kubernetes Prow Robot
e24a42f07b
Merge pull request #88268 from mattjmcnaughton/mattjmcnaughton/delete-image-manager-TODO
Delete TODO in `image_gc_manager`
2020-06-20 17:12:38 -07: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
Haowei Cai
462b75388f let image cache do sort on write instead of on read to avoid data
race and improve efficienty
2020-03-10 15:33:34 -07:00
mattjmcnaughton
f5080850fc
Delete TODO in image_gc_manager
I think the TODO here may have actually been unnecessary. There isn't a
ton of interest around merging
https://github.com/kubernetes/kubernetes/pull/87425, which contains a
fix. Delete the TODO so we don't devote time to working on this area in
the future.
2020-02-18 08:35:29 -05:00
Ted Yu
f6edee0fe1 Use Mutex for synchronization in imageCache 2019-06-01 15:48:55 -07: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
chestack
613f572caf Fix the confusing kubelet logs about imageGC 2018-09-29 18:09:37 +08:00
Pingan2017
158552ff35 fix golint failures - /pkg/kubelet/images 2018-09-17 10:52:25 +08:00
fqsghostcloud
21f9ac0e7e
indent error flow
indent error flow
2018-08-13 17:31:31 +08:00
Jing Xu
b2e744c620 Promote LocalStorageCapacityIsolation feature to beta
The LocalStorageCapacityIsolation feature added a new resource type
ResourceEphemeralStorage "ephemeral-storage" so that this resource can
be allocated, limited, and consumed as the same way as CPU/memory. All
the features related to resource management (resource request/limit, quota, limitrange) are avaiable for local ephemeral storage.

This local ephemeral storage represents the storage for root file system, which will be consumed by containers' writtable layer and logs. Some volumes such as emptyDir might also consume this storage.
2018-03-02 15:10:08 -08:00
Kubernetes Submit Queue
c7b3e163d3
Merge pull request #60448 from Random-Liu/image-cache-return-copy
Automatic merge from submit-queue (batch tested with PRs 59365, 60446, 60448, 55019, 60431). 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>.

Let image manager return a copy of image list.

Fixes https://github.com/kubernetes/kubernetes/issues/60443.
/cc @kubernetes/sig-node-pr-reviews 

**Release note**:

```release-note
none
```
2018-02-27 10:50:41 -08:00
Lantao Liu
1fb91cc8be Let image manager return a copy of image list. 2018-02-26 19:19:18 +00:00
Pingan2017
9f37b5fe52 fix freespace for image GC 2018-02-23 17:25:54 +08:00
David Ashpole
e0830d0b71 reevaluate eviction thresholds after reclaim functions 2018-02-16 08:35:24 -08:00
Seth Jennings
19a546758c kubelet: imagegc: exempt sandbox image 2018-01-17 15:10:44 -06:00
Cao Shufeng
4e7398b67b remove duplicated import 2018-01-17 09:34:59 +08:00
Di Xu
4f400e5d2f ignore images in used by running containers when GC 2017-12-11 15:20:55 +08:00
Yang Guo
f6c36474f2 Change ImageGCManage to consume ImageFS stats from StatsProvider 2017-09-28 10:27:22 -07:00
supereagle
adc0eef43e remove duplicated import and wrong alias name of api package 2017-07-25 10:04:25 +08:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Cao Shufeng
27dafbb87c add unit for freed image size 2017-04-27 16:27:04 +08:00
deads2k
a106d9f848 switch kubelet to use external (client-go) object references for events 2017-01-31 19:15:33 -05:00
deads2k
8a12000402 move client/record 2017-01-31 19:14:13 -05:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
NickrenREN
bb5ccb978e fix image manager Start() function return
realImageGCManager's Start()  function will always return nil,we do not need the err return value,drop it.
2016-12-21 14:58:00 +08:00
Random-Liu
816f867c62 Add image cache. 2016-12-08 14:04:01 -08:00