Hello folks,
I was trying to implement Container garbage collection policy in k8s and found that it was already deprecated in favour of evictionHard and evictionSoft fatures.
opened 02:33PM - 05 Sep 24 UTC
area/kubelet
sig/node
needs-kind
needs-triage
### What happened?
Iam trying to disable maxPerPodContainer feature in my clust… er. To achieve this followed the docs [Container garbage collection](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#container-image-garbage-collection) and gone through code related to garbage collection.
Configured Container garbage collection parameters in the kubelet config file and restarted the kubelet sucessfully.
After that if i check, values in kubelet configuration file are persist but those are actually not reflected in cluster.
### What did you expect to happen?
Container garbage collection parameters which i added in config file should reflect in cluster.
**minAge:
maxPerPodContainer:
maxContainers:**
### How can we reproduce it (as minimally and precisely as possible)?
Ex:
1. Add below values in kubelet configuration file: /var/lib/kubelet/config.yaml
```
minAge: "5m"
maxPerPodContainer: 1
maxContainers: 50
```
2. Restart kubelet service:
`sudo systemctl restart kubelet`
Make sure kubelet restarted sucessfully: sudo systemctl status kubelet
3. Run: kubectl proxy
4. Open another terminal and check whether added parameters are present in configuration or not:
curl http://localhost:8001/api/v1/nodes/<hostname/proxy/configz
### Anything else we need to know?
I tried many ways to add these parameters but no use. even these are not listed in api-resources.
https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
Is it possible to define these values in kubelet as mentioned in [docs](https://kubernetes.io/docs/concepts/architecture/garbage-collection/#container-image-garbage-collection)? if possible how can we configure them?
### Kubernetes version
<details>
```console
$ kubectl version
Client Version: v1.30.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.3
```
</details>
### Cloud provider
<details>
</details>
### OS version
<details>
```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```
</details>
### Install tools
<details>
</details>
### Container runtime (CRI) and version (if applicable)
<details>
</details>
### Related plugins (CNI, CSI, ...) and versions (if applicable)
<details>
</details>
I would like to know the deprecated reason on this.
Also, wikimedia website mentioned container gc flags (--maximum-dead-containers
, --maximum-dead-containers-per-container
, --minimum-container-ttl-duration
) deprated deprecated once old logs are stored outside of container’s context. Is k8s also following the same way of implementaion? Can you please provide me the feature plan on these?
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
<!-- END MUNGE: UNVERSIONED_WARNING -->
# Kubelet - Eviction Policy
**Authors**: Derek Carr (@derekwaynecarr), Vishnu Kannan (@vishh)
**Status**: Proposed (memory evictions WIP)
This document presents a specification for how the `kubelet` evicts pods when compute resources are too low.
## Goals
The node needs a mechanism to preserve stability when available compute resources are low.
This is especially important when dealing with incompressible compute resources such
as memory or disk. If either resource is exhausted, the node would become unstable.
This file has been truncated. show original
Cluster information:
Kubernetes version: v1.30
Cloud being used: bare-metal
Host OS: ubuntu 24.04
CNI and version:
CRI and version:
/cc