kubestellar / galaxy

Additional modules, tools and documentation to facilitate KubeStellar integration with other community projects
Apache License 2.0
0 stars 3 forks source link

:sparkles: Added support to run loki queries against openshift loki installation :sparkles: #15

Closed seepgoel closed 4 months ago

seepgoel commented 4 months ago

Summary

The existing Loki query script works on the Kind deployment which uses dev version of Loki. However, Loki production deployment on openshift needed some changes to the script to work, such as:

  1. Openshift version needs TLS cert and key.
  2. Some of the labels such as pod, nodename etc, are different in openshift. For pod we have kubernetes_pod_name, for container we have kubernetes_container_name.
  3. Openshift Loki version uses X-Scope-OrgID header to be set to either application, infrastructure or audit.

Related issue(s)

Fixes # This PR adds a new variable LOKI_INSTALL_TYPE which can be either openshift or dev. And based on LOKI_INSTALL_TYPE constructs a proper request to be sent to loki. Please note the following instructions:

  1. When LOKI_INSTALL_TYPE is openshift, LOG_TYPE should be one of these three: application, infrastructure or audit.
  2. When LOKI_INSTALL_TYPE is openshift, it is compulsory to specify TLS_CERT_FILE and TLS_KEY_FILE.
  3. You can get the TLS_CERT_FILE and TLS_KEY_FILE from the secret logging-loki-querier-http in the openshift-logging namespace on the openshift cluster where the loki instance has been installed.