Skip to content

Helm chart fails to create the sidecar in the ruler pod in microservices (distributed) mode #16529

Open
@mwtzzz

Description

@mwtzzz

Describe the bug
In SimpleScaleable mode, the helm chart correctly deploys a sidecar inside the backend statefulset when the following parameters are set.

loki:
  rulerConfig:
    enable_alertmanager_v2: true
    alertmanager_url: http://alertmanager.services.stellar-ops.com:9093
    storage:
      type: local
      local:
        directory: /rules

ruler:
  replicas: 0
  maxUnavailable: 0
  extraArgs:
    - '-config.expand-env=true'
  extraEnvFrom:
    - secretRef:
        name: loki-dev-secrets

sidecar:
  rules:
    enabled: true
    folder: /rules/1
    logLevel: debug

But in Distributed mode, it fails to create the sidecar, which results in a ruler pod that does not work properly, with the following errors:

level=error ts=2025-02-21T21:11:16.53272825Z caller=log.go:216 msg="error running loki" err="mkdir /rules: read-only file system

I can fix the ruler by inserting a sidecar myself. But it would be nice if this were handled automatically by helm.

To Reproduce
Steps to reproduce the behavior:

  1. loki 3.4.2 with helm chart loki-6.27.0
  2. cat loki-dev-values-distributed | helm template loki grafana/loki --values=- --namespace ops > loki-01-distributed.yaml
  3. look inside loki-01-distributed.yaml and you will see there is no sidecar container in the loki-ruler statefulset

Expected behavior
I expect a sidecar container inside the loki-ruler StatefulSet, in the same way as taken care of automatically by helm in deploymentMode: SimpleScaleable

Environment:

  • Infrastructure: kubernetes cluster deployed with kubeadm
  • Deployment tool: helm

Screenshots, Promtail config, or terminal output
N/A above description gives reproducible steps

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions