Enable RedHat OpenShift Logging plugin using CLI

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Red Hat OpenShift Logging (RHOL)
    • 5

Issue

  • How can RedHat OpenShift Logging plugin be enabled using CLI ?
  • Step 5 of Deploying the LokiStack documentation mentions enabling Openshift Logging plugin using webconsole. How can this be achieved using CLI?

Resolution

  • As per Deploying the LokiStack documentation, Openshift Logging plugin, i.e. logging-view-plugin is only available on OpenShift Container Platform 4.10 and later. The logging-view-plugin should appear automatically with cluster-logging-operator version >= 5.5 installed and with lokistack as a default log-store. If in case it has been disabled, the below oc patch command helps enable the same:

    $ oc patch consoles.operator.openshift.io cluster   --patch '{ "spec": { "plugins": ["logging-view-plugin"] }  }' --type=merge
    
    $ oc get consoles.operator.openshift.io cluster -o json | jq -r .spec.plugins
      [
      "logging-view-plugin"                      <---------- this means the plugin is enabled
      ]
    

Diagnostic Steps

  • Check the current status of logging-view-plugin if enabled in the OpenShift Console. Below output shows this plugin hasn't been enabled:

    $ oc get consoles.operator.openshift.io cluster -o json | jq -r .spec.plugins
    [
      ""                               <---------this shows there aren't any plugins configured yet                         
    ]
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments