openshift-logging

by tjungbauer

Helm chartv3.0.8Apache-2.0Verified publisher

Deploy and configure OpenShift Logging based on LokiStack

About this chart

openshift-logging

Description

Deploy and configure OpenShift Logging based on LokiStack

This Helm Chart is installing and configuring OpenShift Logging.

WARNING: With the chart version 3, OpenShift Logging Version 6 is supported and should be used for new deployments. It drops the old ClusterLogging and ClusterLogForwarder resources and instead, defines a ClusterlogForwarder resource, where everything can be configured. Moreover, the UI Plugin has been shifted to the Cluster Observability Operator which means that an additional Operator has to be deployed and configured to enable the UI Plugin.

The values file values-v5.0.yaml provides an example for (old) version 5.x.

The values file values-v6.0.yaml provides an example for (new) version 6.x.

NOTE: OpenShift Logging using EFK stack (Elasticsearch, Kibana and Fluentd) is considered as deprecated and has been removed from this Chart. Instead, LokiStack with Vector should be used.

Dependencies

This chart has the following dependencies:

RepositoryNameVersion
https://charts.stderr.at/tpl~1.0.0

It is best used with a full GitOps approach such as Argo CD does. For example, https://github.com/tjungbauer/openshift-clusterconfig-gitops (for example in the folder clusters/management-cluster/setup-openshift-logging)

Maintainers

NameEmailUrl
tjungbauer[email protected]https://blog.stderr.at/

Sources

Source:

Source code: https://github.com/tjungbauer/helm-charts/tree/main/charts/openshift-logging

Parameters

Verify the subcharts for additional settings:

Values

OpenShift Logging 6.0

KeyTypeDefaultDescription
loggingConfig.additionalClusterRoleslistN/AAdditional ClusterRoles and ClusterRoleBindings that shall be created. These Roles and Bindings allow the ServiceAccount to write logs into Loki
loggingConfig.collector.resources.limitsobjectN/ALIMITS for CPU, memory and storage
loggingConfig.collector.resources.requestsobjectN/AREQUESTS for CPU, memory and storage
loggingConfig.collector.tolerationslistN/ADefine the tolerations the collector Pods will accept
loggingConfig.collectorLogLevelstringoffSpecify the log level of the collector. Valid values are: trace, debug, info, warn, error and off
loggingConfig.collectorServiceAccountobject{"bindings":["collect-audit-logs","collect-application-logs","collect-infrastructure-logs"],"create":false,"name":"cluster-logging-operator"}Service Account that shall be used for logging and is used by the collector pods
loggingConfig.collectorServiceAccount.bindingslistN/AList of default bindings for this ServiceAccount. Administrators have to explicitly grant log collection permissions to the ServiceAccount. Three base roles that can be bound to exist: collect-audit-logs ... To collect audit logs collect-application-logs ... To collector application logs collect-infrastructure-logs ... To collect infrastructure logs
loggingConfig.collectorServiceAccount.createboolfalseShall we create the ServiceAccount. cluster-logging-operator is typically deployed by the OpenShift Logging operator once it has been deployed.
loggingConfig.collectorServiceAccount.namestringcluster-logging-operatorName of the ServiceAccount for the collector
loggingConfig.outputs[0]objectemptyEXAMPLE: LokiStack inside OpenShift Name used to refer to the output from a pipeline.

Generic Parameters

KeyTypeDefaultDescription
loggingConfig.enabledboolfalseEnable openshift logging configuration
loggingConfig.managementStatestringManagedIndicator if the resource is 'Managed' or 'Unmanaged' by the operator. This allows administrators to temporarily pause log forwarding by setting.
loggingConfig.operatorVersionstring6Defines if we are going to deploy openshift logging verison 6.x. This changes the possible settings and resources. Possible values are: 5 or 6.
loggingConfig.syncwavestring4Syncwave for the ClusterLogging resource

OpenShift Logging 6.0 - Filters

KeyTypeDefaultDescription
loggingConfig.filterslist[{"name":"detectexception","type":"detectMultilineException"},{"name":"parse-json","type":"parse"}]Transform or drop log messages in the pipeline. Users can define filters that match certain log fields and drop or modify the messages. Filters are applied in the order specified in the pipeline.
loggingConfig.filters[0]object{"name":"detectexception","type":"detectMultilineException"}Name used to refer to the filter from a "pipeline".
loggingConfig.filters[0].typestring"detectMultilineException"Type of filter.
loggingConfig.filters[1].typestring"parse"Type of filter.

OpenShift Logging 5.0

KeyTypeDefaultDescription
loggingConfig.logStoreobjectN/AParameters that are required for OpenShift Logging Version 5.x
loggingConfig.logStore.collector.resourcesobjectN/AThe resource requirements for the collector. Set this only when you know what you are doing
loggingConfig.logStore.collector.resources.limitsobjectN/ALIMITS for CPU, memory and storage
loggingConfig.logStore.collector.resources.requestsobjectN/AREQUESTS for CPU, memory and storage
loggingConfig.logStore.collector.tolerationslistN/ADefine the tolerations the collector Pods will accept
loggingConfig.logStore.collector.typestringvectorThe type of Log Collection to configure Vector in case of Loki.
loggingConfig.logStore.lokistackstringlogging-lokiName of the LokiStack resource.
loggingConfig.logStore.typestring"lokistack"The Type of Log Storage to configure. The operator currently supports either using ElasticSearch managed by elasticsearch-operator or Loki managed by loki-operator (LokiStack) as a default log store. However, Elasticsearch is deprecated and should not be used here ... it would result in an error
loggingConfig.logStore.visualization.ocpConsole.logsLimitintnoneLogsLimit is the max number of entries returned for a query.
loggingConfig.logStore.visualization.ocpConsole.timeoutstringnoneTimeout is the max duration before a query timeout
loggingConfig.logStore.visualization.tolerationslistN/ADefine the tolerations the visualisation Pod will accept
loggingConfig.logStore.visualization.typestringocp-consoleThe type of Visualization to configure Could be either Kibana (deprecated) or ocp-console

OpenShift Logging 6.0 - Outputs

KeyTypeDefaultDescription
loggingConfig.outputslistN/ADefine destinations to forward logs to. Each output has a unique name and type-specific configuration. The outputs sections will be handed-over 1:1 to the Helm tamplte. Each output must have a unique name and a type. Supported types are: azureMonitor Forwards logs to Azure Monitor. cloudwatch: Forwards logs to AWS CloudWatch. elasticsearch: Forwards logs to an external Elasticsearch instance. googleCloudLogging: Forwards logs to Google Cloud Logging. http: Forwards logs to a generic HTTP endpoint. kafka: Forwards logs to a Kafka broker. loki: Forwards logs to a Loki logging backend. lokistack: Forwards logs to the logging supported combination of Loki and web proxy with OpenShift Container Platform authentication integration. LokiStack’s proxy uses OpenShift Container Platform authentication to enforce multi-tenancy otlp: Forwards logs using the OpenTelemetry Protocol. splunk: Forwards logs to Splunk. syslog: Forwards logs to an external syslog server. Each output type has its own configuration fields.
loggingConfig.outputs[0].lokiStack.authenticationobject{"token":{"from":"serviceAccount"}}Authentication sets credentials for authenticating the requests.
loggingConfig.outputs[0].lokiStack.authentication.tokenobject{"from":"serviceAccount"}Token specifies a bearer token to be used for authenticating requests.
loggingConfig.outputs[0].lokiStack.authentication.token.fromstring"serviceAccount"From is the source from where to find the token. Either serviceAccount or secret.
loggingConfig.outputs[0].lokiStack.targetobject{"name":"logging-loki","namespace":"openshift-logging"}Target points to the LokiStack resources that should be used as a target for the output.
loggingConfig.outputs[0].lokiStack.target.namestring"logging-loki"Name of the in-cluster LokiStack resource.
loggingConfig.outputs[0].lokiStack.target.namespacestringopenshift-loggingNamespace of the in-cluster LokiStack resource.
loggingConfig.outputs[0].lokiStack.tuningobject{"compression":"gzip","deliveryMode":"AtLeastOnce","maxRetryDuration":5,"minRetryDuration":5}Tuning specs tuning for the output
loggingConfig.outputs[0].lokiStack.tuning.compressionstring"gzip"The compression algorithm to use to compress the data before sending over the network. NOTE: An output type may not support all available compression options or compression.
loggingConfig.outputs[0].lokiStack.tuning.deliveryModestring"AtLeastOnce"The mode for log forwarding. AtLeastOnce (default): The forwarder will block in an attempt to deliver all messages. When the tuning spec is added to an output, this additionally configures an internal, durable buffer so the collector can attempt to forward any logs read before it restarted AtMostOnce: The forwarder may provide better throughput but also may drop logs in the event of spikes in volume and backpressure from the output. Undelivered, collected logs will be lost on collector restart. NOTE: Log collection and forwarding is best effort. AtLeastOnce delivery mode does not guarantee logs will not be lost.
loggingConfig.outputs[0].lokiStack.tuning.maxRetryDurationint5The maximum time to wait between retry attempts after a delivery failure.
loggingConfig.outputs[0].lokiStack.tuning.minRetryDurationint5The minimum time to wait between attempts to retry after a delivery failure.
loggingConfig.outputs[0].tlsobject{"ca":{"configMapName":"openshift-service-ca.crt","key":"service-ca.crt"}}Define TLS to connect to the (internal) Loki store.
loggingConfig.outputs[0].typestring"lokiStack"Type of output sink.

OpenShift Logging 6.0 - Pipelines

KeyTypeDefaultDescription
loggingConfig.pipelineslist[{"filterRefs":["detectexception","parse-json"],"inputRefs":["application","infrastructure","audit"],"name":"default-lokistack","outputRefs":["default-lokistack"]}]Define the path logs take from inputs, through filters, to outputs. Pipelines have a unique name and consist of a list of input, output and filter names.
loggingConfig.pipelines[0]object{"filterRefs":["detectexception","parse-json"],"inputRefs":["application","infrastructure","audit"],"name":"default-lokistack","outputRefs":["default-lokistack"]}Name of the pipeline
loggingConfig.pipelines[0].filterRefslist["detectexception","parse-json"]Filters lists the names of filters to be applied to records going through this pipeline.
loggingConfig.pipelines[0].inputRefslist["application","infrastructure","audit"]InputRefs lists the names (input.name) of inputs to this pipeline. The following built-in input names are always available: application selects all logs from application pods. infrastructure selects logs from openshift and kubernetes pods and some node logs. audit selects node logs related to security audits.
loggingConfig.pipelines[0].outputRefslist["default-lokistack"]OutputRefs lists the names (output.name) of outputs from this pipeline.

Example values OpenShift Logging 6.x

---
loggingConfig:
  enabled: true

  syncwave: '4'

  operatorVersion: '6'

  managementState: Managed

  collectorServiceAccount:
    name: cluster-logging-operator
    create: false
    bindings:
      - collect-audit-logs
      - col

Deploy openshift-logging with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has openshift-logging on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartopenshift-logging is pinned at v3.0.8 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply