openshift / cluster-node-tuning-operator

Manage node-level tuning by orchestrating the tuned daemon.
Apache License 2.0
98 stars 104 forks source link

Node tune operator failed to handle the sysctl name with dot #1128

Open luolanzone opened 1 month ago

luolanzone commented 1 month ago

Hi I checked this document and tried to update rp_filter of a sub-interface named 'antrea-ext.10' with the following manifest:

apiVersion: tuned.openshift.io/v1
kind: Tuned
metadata:
  name: antrea
  namespace: openshift-cluster-node-tuning-operator
spec:
  profile:
  - data: |
      [main]
      summary=Update Antrea VLAN interface rp_fitler
      [sysctl]
      net.ipv4.conf.antrea-ext\\.10.rp_filter=2 // net.ipv4.conf."antrea-ext.10".rp_filter=2 also failed
    name: openshift-antrea
  recommend:
  - match:
    - label: network-role
      value: egress-gateway
    priority: 30
    profile: openshift-antrea

I tried both ways with '\\' or double quote but none of them work.

2024-08-07 02:46:41,098 INFO     tuned.daemon.daemon: stopping tuning
2024-08-07 02:46:41,099 INFO     tuned.daemon.daemon: Running in automatic mode, checking what profile is recommended for your configuration.
2024-08-07 02:46:41,099 INFO     tuned.daemon.daemon: Using 'openshift-antrea' profile
2024-08-07 02:46:41,100 INFO     tuned.profiles.loader: loading profile: openshift-antrea
2024-08-07 02:46:41,100 INFO     tuned.daemon.daemon: starting tuning
2024-08-07 02:46:41,101 ERROR    tuned.utils.commands: Error when reading file '/proc/sys/net/ipv4/conf/antrea-ext\\/10/rp_filter': '[Errno 2] No such file or directory: '/proc/sys/net/ipv4/conf/antrea-ext\\\\/10/rp_filter''
2024-08-07 02:46:41,102 ERROR    tuned.plugins.plugin_sysctl: sysctl option net.ipv4.conf.antrea-ext\\.10.rp_filter will not be set, failed to read the original value.
2024-08-07 02:46:41,102 INFO     tuned.plugins.plugin_sysctl: reapplying system sysctl
2024-08-07 02:46:41,103 INFO     tuned.daemon.daemon: static tuning from profile 'openshift-antrea' applied

The version of OCP I tried is v4.16.

luolanzone commented 1 month ago

According to sysctl man page / is also accepted:

PARAMETERS
       variable
              The name of a key to read from.  An example is kernel.ostype.  The '/' separator is also accepted in place of a '.'., 

so I all tried net/ipv4/conf/antrea-ext.10/rp_filter=2 but also failed with following errors:

2024-08-07 03:23:49,609 INFO     tuned.daemon.daemon: stopping tuning
2024-08-07 03:23:49,610 INFO     tuned.daemon.daemon: Running in automatic mode, checking what profile is recommended for your configuration.
2024-08-07 03:23:49,610 INFO     tuned.daemon.daemon: Using 'openshift-antrea' profile
2024-08-07 03:23:49,611 INFO     tuned.profiles.loader: loading profile: openshift-antrea
2024-08-07 03:23:49,611 INFO     tuned.daemon.daemon: starting tuning
2024-08-07 03:23:49,612 ERROR    tuned.utils.commands: Error when reading file '/proc/sys/net.ipv4.conf.antrea-ext/10.rp_filter': '[Errno 2] No such file or directory: '/proc/sys/net.ipv4.conf.antrea-ext/10.rp_filter''
2024-08-07 03:23:49,612 ERROR    tuned.plugins.plugin_sysctl: sysctl option net/ipv4/conf/antrea-ext.10/rp_filter will not be set, failed to read the original value.
2024-08-07 03:23:49,612 INFO     tuned.plugins.plugin_sysctl: reapplying system sysctl
2024-08-07 03:23:49,614 INFO     tuned.daemon.daemon: static tuning from profile 'openshift-antrea' applied