-
Notifications
You must be signed in to change notification settings - Fork 226
Description
Problem Description
When running tuned-adm profile <any-profile>, TuneD breaks Kubernetes overlay networking (tested with Canal/Calico CNI). The overlay network (pod network) becomes completely unreachable after any profile switch.
Root Cause
The reapply_sysctl=1 setting (default) causes TuneD to re-apply ALL sysctl settings from /run/sysctl.d/, /etc/sysctl.d/, and /etc/sysctl.conf after every profile application. This overwrites runtime sysctl changes made by Kubernetes CNI plugins.
Specifically, CNI plugins set net.ipv4.ip_forward=1 at runtime, but system sysctl.d files typically contain net.ipv4.ip_forward=0, which gets re-applied and breaks routing.
Code location: tuned/plugins/plugin_sysctl.py lines 83-85 and 103-156
Steps to Reproduce
- Deploy a Kubernetes cluster with overlay networking (e.g., Canal, Calico, Flannel)
- Verify pod-to-pod networking works
- Run
tuned-adm profile balanced(or any profile) - Pod-to-pod networking breaks immediately
- Check:
sysctl net.ipv4.ip_forwardshows0instead of1
Expected Behavior
TuneD should provide a way to exclude specific sysctl parameters from reapplication, allowing Kubernetes CNI plugins to manage networking sysctls independently.
Proposed Solution
Add a reapply_sysctl_exclude configuration option to /etc/tuned/tuned-main.conf that accepts a comma-separated list of sysctl patterns (supporting shell-style wildcards via fnmatch).
Example configuration:
reapply_sysctl_exclude = net.ipv4.ip_forward, net.ipv6.conf.*.forwarding, net.bridge.bridge-nf-call-iptablesWorkarounds
Current workarounds (all have drawbacks):
- Set
reapply_sysctl=0- disables ALL sysctl reapplication - Modify
/etc/sysctl.d/files - may conflict with security policies - Add CNI sysctls to TuneD profile - requires custom profiles
Environment
- TuneD version: 2.26.0
- Kubernetes: Various versions
- CNI: Canal (also affects Calico, Flannel, and others)
- OS: RHEL/CentOS/Rocky Linux