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:
Openshift version needs TLS cert and key.
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.
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:
When LOKI_INSTALL_TYPE is openshift, LOG_TYPE should be one of these three: application, infrastructure or audit.
When LOKI_INSTALL_TYPE is openshift, it is compulsory to specify TLS_CERT_FILE and TLS_KEY_FILE.
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.
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:
kubernetes_pod_name
, for container we havekubernetes_container_name
.X-Scope-OrgID
header to be set to eitherapplication
,infrastructure
oraudit
.Related issue(s)
Fixes # This PR adds a new variable
LOKI_INSTALL_TYPE
which can be eitheropenshift
ordev
. And based onLOKI_INSTALL_TYPE
constructs a proper request to be sent to loki. Please note the following instructions:openshift
, LOG_TYPE should be one of these three: application, infrastructure or audit.openshift
, it is compulsory to specify TLS_CERT_FILE and TLS_KEY_FILE.logging-loki-querier-http
in theopenshift-logging
namespace on the openshift cluster where the loki instance has been installed.