operator/docs/user-guides/gateway-config.md
This document describes how to configure the LokiStack Gateway component.
The LokiStack Gateway is a reverse-proxy component that provides secure access to Loki for multi-tenant authentication and authorization. By default, the operator creates external access resources to make the gateway accessible from outside the cluster:
You can disable external access creation.
To disable automatic creation of external access resources:
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: lokistack-dev
spec:
...
tenants:
mode: static # or openshift-logging, openshift-network, dynamic
disableIngress: true # Disable external access resource creation
Result:
You can explicitly enable external access (same as default behavior):
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: lokistack-dev
spec:
...
tenants:
mode: static # or openshift-logging, openshift-network, dynamic
disableIngress: false # Explicitly enable external access (default)
If the httpEncryption is enabled in the project config, users can provide a custom TLS certificate for the Gateway. If running on OpenShift this certificate will be used instead of the auto-generated certificates.
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: lokistack-dev
spec:
tenants:
mode: static
gateway:
tls:
certificate:
secretName: my-tls-cert-secret
key: tls.crt
privateKey:
secretName: my-tls-cert-secret
key: tls.key
If necessary users can also pass a custom CA through the ca field:
spec:
tenants:
mode: static
gateway:
tls:
ca:
configMapName: my-ca-bundle
key: ca.crt
The CA Certificate is necessary for:
Internal Healthcheck Verification: The Gateway performs periodic self-checks by making HTTP requests to itself. When httpEncryption is enabled the gateway is running with TLS enabled, the healthcheck client needs to be able to verify the gateway TLS certificate.
Metrics Scraping: When serviceMonitorTlsEndpoints is enabled the CA is used in the Prometheus ServiceMonitor to allow secure scraping of Gateway metrics over HTTPS.
Important: When custom TLS is configured, OpenShift Routes automatically change to passthrough termination mode.
When you change the external access configuration from enabled to disabled: