Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[loki] 6.6.3 template failure with using imagePullSecret #3168

Closed
MathiasRudolphSec opened this issue Jun 12, 2024 · 2 comments
Closed

[loki] 6.6.3 template failure with using imagePullSecret #3168

MathiasRudolphSec opened this issue Jun 12, 2024 · 2 comments

Comments

@MathiasRudolphSec
Copy link

When setting a imagePullSecret the template fails to render.

Error: template: loki/templates/results-cache/statefulset-results-cache.yaml:1:4: executing "loki/templates/results-cache/statefulset-results-cache.yaml" at <include "loki.memcached.statefulSet" (dict "ctx" $ "valuesSection" "resultsCache" "component" "results-cache")>: error calling include: template: loki/templates/memcached/_memcached-statefulset.tpl:75:17: executing "loki.memcached.statefulSet" at <$.ctx.Values.image.pullSecrets>: nil pointer evaluating interface {}.pullSecrets
helm.go:84: [debug] template: loki/templates/results-cache/statefulset-results-cache.yaml:1:4: executing "loki/templates/results-cache/statefulset-results-cache.yaml" at <include "loki.memcached.statefulSet" (dict "ctx" $ "valuesSection" "resultsCache" "component" "results-cache")>: error calling include: template: loki/templates/memcached/_memcached-statefulset.tpl:75:17: executing "loki.memcached.statefulSet" at <$.ctx.Values.image.pullSecrets>: nil pointer evaluating interface {}.pullSecrets

in templates/memcached/_memcached-statefulset.tpl:75:17 the relevant code is:

      {{- if $.ctx.Values.imagePullSecrets }}
      imagePullSecrets:
      {{- range $.ctx.Values.image.pullSecrets }}
        - name: {{ . }}
      {{- end }}
      {{- end }}

The range tries to access image.pullSecret which maybe a typo? When fixed to imagePullSecret the template renders successfully.

The following values file reproduces the bug:

# -- Image pull secrets for Docker images
imagePullSecrets:
  - "image-pull-secret"

deploymentMode: SingleBinary

loki:
  # https://grafana.com/docs/loki/latest/configure/#limits_config
  limits_config:
    # Retention period to apply to stored data, only applies if retention_enabled is
    # true in the compactor config. As of version 2.8.0, a zero value of 0 or 0s
    # disables retention. In previous releases, Loki did not properly honor a zero
    # value to disable retention and a really large value should be used instead.
    retention_period: 168h # 7d
    # Limit how far back in time series data and metadata can be queried, up until
    # lookback duration ago. This limit is enforced in the query frontend, the
    # querier and the ruler. If the requested time range is outside the allowed
    # range, the request will not fail, but will be modified to only query data
    # within the allowed time range. The default value of 0 does not set a limit.
    max_query_lookback: 168h # 7d
  commonConfig:
    replication_factor: 1
  storage:
    type: 'filesystem'
  # https://grafana.com/docs/loki/latest/configure/#schema_config
  schemaConfig:
    configs:
      - from: 2020-01-01
        store: tsdb
        object_store: filesystem
        schema: v13
        index:
          prefix: index_
          period: 24h
        chunks:
          prefix: chunks_
          period: 24h
  # https://grafana.com/docs/loki/latest/configure/#compactor
  compactor:
    retention_enabled: true
    delete_request_store: filesystem

Tried with helm template --debug -f values.yaml loki/

@Sheikh-Abubaker
Copy link
Collaborator

loki chart is no longer maintained here, it is maintained in the loki repo: https://github.com/grafana/loki/tree/main/production/helm/loki

but apart from this I'll fix it by opening a PR.

@danteu
Copy link

danteu commented Oct 8, 2024

This issue was fixed with chart version 6.9.0: grafana/loki#13788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants