Review kubelet kernel-setting protection

Manage kernel settings before startup and review whether kubelet should adjust them automatically.

Description

With protectKernelDefaults set to false, the kubelet tries to adjust the kernel settings it checks. With true, it reports an error if they differ from its expected values.

Potential impact

Automatic changes can conflict with a managed host configuration. Enabling protection before the values match can prevent the kubelet from starting.

Remediation

Check the requirements for the node’s kubelet version and apply the required values to the host first. To prevent automatic changes, set protectKernelDefaults: true, then verify kubelet startup and node health. Restrict workload sysctl permissions separately.

Examples

The excerpts change the legacy --protect-kernel-defaults argument. The foo/bar image is a placeholder. Apply the setting to the node’s actual kubelet.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: foo/bar
      command: ["kubelet"]
      args: ["--protect-kernel-defaults=false"]

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: foo/bar
      command: ["kubelet"]
      args: ["--protect-kernel-defaults=true"]

References