Uploaded image for project: 'OpenShift Logging'
  1. OpenShift Logging
  2. LOG-6586

fluentd does not honour the cluster-wide no_proxy configuration for http output

XMLWordPrintable

    • False
    • None
    • False
    • NEW
    • NEW
    • Hide
      This change fixes the regression from 5.8 where fluentd was patched to support HTTP proxy, originally reported fixed in LOG-5466.
      Show
      This change fixes the regression from 5.8 where fluentd was patched to support HTTP proxy, originally reported fixed in LOG-5466 .
    • Bug Fix
    • Log Collection - Sprint 266
    • Moderate

      Description of problem:

      It's the same reported in LOG-5466 that should be fixed in Logging 5.9.2, but reviewing the code for Logging 5.9.10, it doesn't contain the fix [0] for when the collector type is fluentd leading to not honour the "no_proxy" configuration available in the cluster-wide proxy.

      Version-Release number of selected component (if applicable):

      5.9.10
      collector type fluentd
      output type: HTTP

      How reproducible:

      Always

      Steps to Reproduce:

      Logging 5.9.10 doesn't contain the fix [0] for bug LOG-5466 [1]:

      Let's install Logging 5.9.10 that should be expected to contain the fix [0] for bug LOG-5466 [1]:

      $ oc get csv |grep logging
      cluster-logging.v5.9.10           Red Hat OpenShift Logging                        5.9.10      cluster-logging.v5.9.10                      Succeeded
      

      Let's review that the collector type is fluentd:

      $ oc get clusterlogging instance -o jsonpath='{.spec.collection.type}' 
      fluentd
      

      Let's verify that the fix [0] for taking into consideration the "no_proxy" configuration is not in the file `/usr/share/ruby/net/http.rb`:

      $ pod=$(oc get pods -l component=collector -o jsonpath='{.items[0].metadata.name}')
      $ oc rsh $pod cat /usr/share/ruby/net/http.rb > /tmp/5910_http.rb
      

      It's visible that the fix [0] is not present in the source file `/usr/share/ruby/net/http.rb` inside the fluentd container:

      $ grep "http = new(address, port" /tmp/5910_http.rb 
            http = new(address, port, p_addr, p_port, p_user, p_pass)
            
      $ grep "if p_addr && p_no_proxy" /tmp/5910_http.rb 
              if p_addr && p_no_proxy && !URI::Generic.use_proxy?(p_addr, p_addr, p_port, p_no_proxy)
      

      Logging 5.8.16 contains the fix [0] for bug LOG-4784 [4]

      $ oc get csv|grep logging
      cluster-logging.v5.8.1           Red Hat OpenShift Logging                        5.8.1      cluster-logging.v5.8.0                      Succeeded
      
      $ pod=$(oc get pods -l component=collector -o jsonpath='{.items[0].metadata.name}')
      $ oc rsh $pod cat /usr/share/ruby/net/http.rb > /tmp/581_http.rb
      

      Let's see that the fluentd collect pod in Logging 5.8.16 contains the fix [0]

      $ grep "http = new(address, port" /tmp/581_http.rb 
            http = new(address, port, p_addr, p_port, p_user, p_pass, (ENV['NO_PROXY']||ENV['no_proxy']))
      
      $ grep "if p_addr && p_no_proxy" /tmp/581_http.rb 
              if p_addr && p_no_proxy && !URI::Generic.use_proxy?(address, address, p_port, p_no_proxy)
      

      Actual results:

      Logging 5.9.10 with fluentd as collector type and configured the OpenShift cluster with the cluster-wide proxy doesn't honour the no_proxy options

      Expected results:

      Logging 5.9.10 with fluentd as collector honours the OpenShift cluster-wide no_proxy options

      [0] https://github.com/ViaQ/logging-fluentd/blob/v1.16.x/fluentd/log4366_ruby_lib_net_http.patch
      [1] https://issues.redhat.com/browse/LOG-5466
      [2] https://github.com/ViaQ/logging-fluentd/blob/3d1274cb223f2f421db47598bff7a35bcbbd9f3e/fluentd/log4366_ruby_lib_net_http.patch#L20
      [3] https://github.com/ViaQ/logging-fluentd/blob/3d1274cb223f2f421db47598bff7a35bcbbd9f3e/fluentd/log4366_ruby_lib_net_http.patch#L18
      [4] https://issues.redhat.com/browse/LOG-4784

              jcantril@redhat.com Jeffrey Cantrill
              rhn-support-ocasalsa Oscar Casal Sanchez
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: