Reference / experimental
loki
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Grafana Loki log store, single binary on one volume
This page is generated from kix/packages/experimental/loki.
| Stability | Experimental |
package value | packages.experimental.loki |
| Default software version | 3.7.10 |
| Default aliases | loki |
| Highest availability level | none |
How-to guides
Section titled “How-to guides”Dependencies
Section titled “Dependencies”Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set deps.<name> in your cluster definition. See Declaring dependencies for how required and optional dependencies work.
| Dependency | Requirement |
|---|---|
storage | Required |
prometheus | Optional |
Options
Section titled “Options”Extra environment variables. A value is a string, a fieldRef source such as { valueFrom.fieldRef.fieldPath = "metadata.name"; }, or a secretKeyRef source naming a Secret managed outside Kix with kix.untrackedRef. A credential that comes from a dependency is wired by the package. Null removes a variable the package sets by default.
- Type:
attribute set of (null or string or env var source with `valueFrom`) - Default:
{ }
extraArgs
Section titled “extraArgs”Flags appended after the package’s own. Loki applies flags after
its config file, so the flags that would override a locked
settings path (-auth.enabled, -server.http-listen-port,
-common.path-prefix, -common.storage.filesystem.*,
-common.storage.ring.{instance-addr,store,replication-factor}),
-config.file, -config.expand-env, and -target fail
evaluation.
-
Type:
list of string -
Default:
[ ] -
Example:
1[2"-log.format=json"3]
healthCheck.enabled
Section titled “healthCheck.enabled”Run the package’s post-deploy probe (kix.healthCheck) once its resources are ready. A failing probe fails the deploy before the activation switches.
- Type:
boolean - Default:
false
healthCheck.retryFor
Section titled “healthCheck.retryFor”Seconds the probe keeps re-checking before it gives up, so a target still restarting from the rollout does not fail the deploy. The Job’s deadline is sized from it.
- Type:
signed integer - Default:
90
Container image for this instance. Set it from a pin file (kix.pins) so the deployed reference is committed and resolved.
-
Type:
submodule -
Default:
1{2digest = "sha256:b43c257ccfc925d4a50b8717cac61a3b51df8c48d01847936057e5c4075a24a7";3pullPolicy = "IfNotPresent";4repository = "docker.io/grafana/loki";5tag = "3.7.10";6}
image.digest
Section titled “image.digest”Resolved manifest digest, sha256: followed by 64 hex characters. What will actually run. Null means not resolved.
- Type:
null or string - Default: the package’s digest while
tagis the package’s tag, otherwise null
image.note
Section titled “image.note”Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.
- Type:
null or string - Default:
null
image.promotedBy
Section titled “image.promotedBy”Who resolved this pin, for the record. Null when unknown.
- Type:
null or string - Default:
null
image.pullPolicy
Section titled “image.pullPolicy”imagePullPolicy for containers using this image. Null leaves it to Kubernetes.
- Type:
null or string - Default:
"IfNotPresent"
image.repository
Section titled “image.repository”Image repository, registry host included.
- Type:
string - Default:
"docker.io/grafana/loki"
image.resolvedAt
Section titled “image.resolvedAt”When this pin was resolved, RFC 3339. Null when unknown.
- Type:
null or string - Default:
null
image.sourceRev
Section titled “image.sourceRev”Revision of the source the image was built from, when Kix built it. Null for upstream images.
- Type:
null or string - Default:
null
image.tag
Section titled “image.tag”Image tag. What was asked for.
- Type:
string - Default:
"3.7.10"
metrics.enabled
Section titled “metrics.enabled”Enable metrics endpoint and monitoring resources (ServiceMonitor, PrometheusRules) when prometheus is available.
- Type:
boolean - Default:
true
metrics.interval
Section titled “metrics.interval”Scrape interval (e.g. ”30s”). Null = use Prometheus default.
- Type:
null or string - Default:
null
metrics.maxCompactionAge
Section titled “metrics.maxCompactionAge”How long Loki may go without a successful compaction, or with retention on, a successful retention run, before LokiCompactionStale or LokiRetentionStale fires, as a Prometheus duration. Null derives each rule’s threshold from the merged settings: twice compactor.compaction_interval (or compactor.apply_retention_interval for retention) plus one hour, and at least 3h, the Loki mixin’s threshold. At the default 10m interval both are 3h.
- Type:
null or string matching the pattern ([0-9]+(ms|s|m|h|d|w|y))+ - Default:
null - Example:
"6h"
metrics.requestErrorMinRate
Section titled “metrics.requestErrorMinRate”Requests per second a route must serve before LokiRequestErrors considers its error ratio, so a few failures on a rarely used route do not fire it.
- Type:
nonnegative integer or floating point number, meaning >=0 - Default:
0.1 - Example:
1
metrics.requestErrorRatio
Section titled “metrics.requestErrorRatio”Share of a route’s HTTP requests that may answer 5xx before LokiRequestErrors fires. The default is the Loki mixin’s.
- Type:
integer or floating point number between 0 and 1 (both inclusive) - Default:
0.1 - Example:
0.05
resources
Section titled “resources”Container resource requests and limits. Each field keeps its default until set, and null removes a default.
-
Type:
submodule -
Default:
1{2limits = {3cpu = "1";4memory = "1Gi";5};6requests = {7cpu = "100m";8memory = "256Mi";9};10}
resources.claims
Section titled “resources.claims”Dynamic resource claims the container uses. Null leaves it unset.
- Type:
null or (list of (submodule)) - Default:
null
resources.claims.*.name
Section titled “resources.claims.*.name”Name of an entry in the pod’s resourceClaims.
- Type:
string
resources.claims.*.request
Section titled “resources.claims.*.request”Request within the claim to use. Null uses the whole claim.
- Type:
null or string - Default:
null
resources.limits
Section titled “resources.limits”Resource quantities by name.
- Type:
open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
{ }
resources.limits.cpu
Section titled “resources.limits.cpu”The cpu quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"1"
resources.limits.ephemeral-storage
Section titled “resources.limits.ephemeral-storage”The ephemeral-storage quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
null
resources.limits.memory
Section titled “resources.limits.memory”The memory quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"1Gi"
resources.requests
Section titled “resources.requests”Resource quantities by name.
- Type:
open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
{ }
resources.requests.cpu
Section titled “resources.requests.cpu”The cpu quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"100m"
resources.requests.ephemeral-storage
Section titled “resources.requests.ephemeral-storage”The ephemeral-storage quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
null
resources.requests.memory
Section titled “resources.requests.memory”The memory quantity. Null leaves it unset.
- Type:
null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei) - Default:
"256Mi"
settings
Section titled “settings”Loki configuration (config.yaml keys) merged over the package’s
own. A null removes a key the package sets. A list replaces the
package’s list whole, so a new schema_config.configs period
restates the earlier ones. The package locks auth_enabled,
server.http_listen_port, common.path_prefix,
common.storage.filesystem, common.instance_addr,
common.ring.kvstore, and common.replication_factor; setting
one, or replacing a key above it, fails evaluation. A component’s
own key (for example ingester.lifecycler.ring) takes precedence
over its common default in Loki and is not locked.
Loki runs with -config.expand-env=true, so ${NAME} in a value
reads the container’s env var NAME (set it through env); an unset
variable becomes an empty string. Write $$ for a literal $.
-
Type:
attribute set of anything -
Default:
{ } -
Example:
1{2limits_config = {3retention_period = "720h";4};5}