1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/logging-loki-zone-aware-rep.adoc

33 lines
1.6 KiB
Plaintext

// Module included in the following assemblies:
//
// * logging/cluster-logging-loki.adoc
:_mod-docs-content-type: CONCEPT
[id="logging-loki-zone-aware-rep_{context}"]
= Zone aware data replication
In the {logging} 5.8 and later versions, the {loki-op} offers support for zone-aware data replication through pod topology spread constraints. Enabling this feature enhances reliability and safeguards against log loss in the event of a single zone failure. When configuring the deployment size as `1x.extra.small`, `1x.small`, or `1x.medium,` the `replication.factor` field is automatically set to 2.
To ensure proper replication, you need to have at least as many availability zones as the replication factor specifies. While it is possible to have more availability zones than the replication factor, having fewer zones can lead to write failures. Each zone should host an equal number of instances for optimal operation.
.Example LokiStack CR with zone replication enabled
[source,yaml]
----
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: logging-loki
namespace: openshift-logging
spec:
replicationFactor: 2 # <1>
replication:
factor: 2 # <2>
zones:
- maxSkew: 1 # <3>
topologyKey: topology.kubernetes.io/zone # <4>
----
<1> Deprecated field, values entered are overwritten by `replication.factor`.
<2> This value is automatically set when deployment size is selected at setup.
<3> The maximum difference in number of pods between any two topology domains. The default is 1, and you cannot specify a value of 0.
<4> Defines zones in the form of a topology key that corresponds to a node label.