grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.85k stars 3.44k forks source link

[Helm] loki pod does expect `rules-temp` file #7806

Open H777K opened 1 year ago

H777K commented 1 year ago

Describe the bug

If i deploy the loki helm chart with the rules_directory set to /var/loki/rules the pod will output in the log that the file /var/loki/rules-temp can not be found:

level=info caller=mapper.go:46 msg="cleaning up mapped rules directory" path=/var/loki/rules-temp
level=error caller=mapper.go:50 msg="unable to read rules directory" path=/var/loki/rules-temp err="open /var/loki/rules-temp: no such file or directory" 

To Reproduce Steps to reproduce the behavior:

  1. create values file for override:
# values.yaml
loki:
  commonConfig:
    path_prefix: /var/loki
  limits_config:
    retention_period: 744h
  storage:
    type: filesystem
    filesystem:
      chunks_directory: /var/loki/chunks
      rules_directory: /var/loki/rules
  ring:
    kvstore:
      store: inmemory
    replication_factor: 1
  rulerConfig:
    storage:
      type: local
  auth_enabled: false
monitoring:
  serviceMonitor:
    enabled: true

grafana-agent-operator:
  podSecurityContext:
    runAsUser: 10001
  1. add helm repository:
helm repo add grafana https://grafana.github.io/helm-charts
  1. install helm release:
helm install loki grafana/loki -f values.yaml
  1. check the logs of the loki-0 pod:
kubectl logs loki-0

Expected behavior

I would expect that the log file should show the /var/loki/rules file instead /var/loki/rules-temp because the first one is set as rules_repository.

Environment:

Screenshots, Promtail config, or terminal output If applicable, add any output to help explain your problem.

H777K commented 1 year ago

@candlerb found your post named Why is "rules-temp" directory accessed? in the community forum - did you find any solution?

candlerb commented 1 year ago

No, I got no answer.