Remount sysctl paths in Docker entrypoint #5958
Open
+49
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Kubelet attempts to enforce certain sysctl tunables in /proc/sys. If the host configuration differs from what kubelet expects, errors may occur, such as "Failed to start ContainerManager: open /proc/sys/kernel/panic: read-only file system" or similar. Mitigate this by remounting /proc/sys in read-write mode if necessary.
The tunables only need to be set once and will stay in place until the next time the host reboots. If the values match the kubelet's expectations, the containers could get away with a read-only /proc/sys. This is inconvenient. Therefore, perform an automatic remount. Users may opt out of this via an environment variable.
Reference: https://github.com/kubernetes/kubernetes/blob/v1.33.1/pkg/kubelet/cm/container_manager_linux.go#L412
Note that if kubelet is running in a user namespace and the KubeletInUserNamespace alpha feature gate is enabled, kubelet will ignore any errors when setting tunables.
Type of change
How Has This Been Tested?
Checklist