Skip to content

Unclear with Container garbage collection configuration #127157

Open
kubernetes/website
#48001
@T-Lakshmi

Description

@T-Lakshmi

What happened?

Iam trying to disable maxPerPodContainer feature in my cluster. To achieve this followed the docs Container 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
  1. Restart kubelet service:
    sudo systemctl restart kubelet
    Make sure kubelet restarted sucessfully: sudo systemctl status kubelet

  2. Run: kubectl proxy

  3. 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? if possible how can we configure them?

Kubernetes version

$ kubectl version
Client Version: v1.30.3
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.3

Cloud provider

OS version

# 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

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

Labels

area/kubelethelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/documentationCategorizes issue or PR as related to documentation.needs-kindIndicates a PR lacks a `kind/foo` label and requires one.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.sig/nodeCategorizes an issue or PR as relevant to SIG Node.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

Status

Triaged

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions