Collect Network Data from Custom Named Network Cards

TOC

Scenario Description

After creating a workload cluster, the platform monitoring can only recognize network card names matching patterns like eth.*|en.*|wl.*|ww.* by default. For user-defined network card names, network traffic data cannot be viewed on the monitoring page. To address this, the platform supports modifying relevant resource parameters to manually capture network card traffic data.

Procedure

  1. Log in to the control node of the global cluster and execute the following commands using kubectl.

  2. First, find the moduleinfo resource name corresponding to the workload cluster in the global cluster:

    kubectl get moduleinfo | grep -E 'prometheus|victoriametrics'

    Example output:

    global-6448ef7f7e5e3924c1629fad826372e7     global     prometheus          prometheus                          Running   v3.15.0-zz231204040711-9d1fc12474c2   v3.15.0-zz231204040711-9d1fc12474c2   v3.15.0-zz231204040711-9d1fc12474c2
    ovn-0954f21f0359720e8c115804376b3e7e        ovn        prometheus          prometheus                          Running   v3.15.0-zz231204040711-9d1fc12474c2   v3.15.0-zz231204040711-9d1fc12474c2   v3.15.0-zz231204040711-9d1fc12474c2
  3. Edit the moduleinfo resource of the workload cluster, replacing ovn-0954f21f0359720e8c115804376b3e7e with the workload cluster moduleinfo resource name from the previous step:

    kubectl edit moduleinfo ovn-0954f21f0359720e8c115804376b3e7e
  4. Add the valuesOverride field and modify the field and regular expression according to the comment information:

    spec:
      valuesOverride: # If this field does not exist, you need to add the valuesOverride field and the following parameters under spec
        ait/chart-cpaas-monitor:
          ovn: # Replace with the workload cluster name
            indicator:
              networkDevice: eth.*|em.*|en.*|wl.*|ww.*|[A-Z].*i|custom_interface # Replace custom_interface with a custom regular expression to ensure correct network card name matching
  5. Wait 10 minutes, then check the network-related charts on the node monitoring page to ensure the changes take effect.