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

ImagePullSecret for loki memcached with error #12632

Closed
V1ct0rHM opened this issue Apr 16, 2024 · 5 comments · Fixed by #13051
Closed

ImagePullSecret for loki memcached with error #12632

V1ct0rHM opened this issue Apr 16, 2024 · 5 comments · Fixed by #13051
Labels
3.0 area/helm type/bug Somehing is not working as expected

Comments

@V1ct0rHM
Copy link

V1ct0rHM commented Apr 16, 2024

Describe the bug
The bug in this situation arises from a mismatch between the structure of the values provided in the values.yaml file and the way the template is trying to access them.

In the template, the .pullSecrets field is being accessed under $.ctx.Values.image.pullSecrets. However, in the values.yaml file, the imagePullSecrets field is defined directly under the top-level key.

Because of this mismatch, when the template tries to access .pullSecrets, it encounters a nil pointer error because it expects the field to be nested under image and pullSecrets, but it's not structured that way in the values.yaml file.

To fix this bug, the template needs to be adjusted to directly access the imagePullSecrets field from the values.yaml file without assuming any nesting. This ensures that the template matches the structure of the provided values, preventing the nil pointer error.

To Reproduce
Steps to reproduce the behavior:

  1. Started Loki helm chart 6.2.0
  2. Started Promtail 6.15.5
  3. No queries

Expected behavior
The expected behavior is that the Helm chart template correctly retrieves the imagePullSecrets field from the values.yaml file and uses it to populate the imagePullSecrets field in the generated Kubernetes manifests.

Specifically, when the template is rendered, it should iterate over the list of image pull secrets provided in the values.yaml file and include them in the generated StatefulSet manifest under the spec.template.spec.imagePullSecrets field.

The corrected behavior ensures that the Helm chart can be customized with the appropriate image pull secrets, allowing the deployment to access private Docker registries or other protected image sources as needed.

Environment:

  • Infrastructure: EKS 1.28
  • Deployment tool: Helm and ArgoCD

Screenshots, Promtail config, or terminal output
image
image

I have a proposed change here:

{{- range $.ctx.Values.image.pullSecrets }}

To => {{- range $.ctx.Values.imagePullSecrets }}

@zesty-henitzhaki
Copy link

zesty-henitzhaki commented Apr 18, 2024

image:
  pullSecrets:
  - regcred

imagePullSecrets:
- name: regcred

Quick Solution..
Until the repair

@V1ct0rHM
Copy link
Author

image:
  pullSecrets:
  - regcred

imagePullSecrets:
- name: regcred

Quick Solution..
Until the repair

I did this for now, thanks lmk if you want me to open a PR

@EvertonSA
Copy link
Contributor

this is a very old discussion, I prefer imagePullSecrets but many grafana charts are using image.PullSecrets.

not a simple change as many people would be affected

@EvertonSA
Copy link
Contributor

@fmannaixn
Copy link

What is holding up Haibread's PR from being reviewed and merged? Should I update it and bump it to 6.6.7? Is there any other reason it didn't get reviewed by the Loki team?

This isn't a semantic discussion about whether the chart should use imagePullSecrets or image.pullSecrets, it's a bug where the template checks if Values.imagePullSecrets is defined, which is the value the other templates in the chart use, but then iterates over the nil value of Values.image.pullSecrets. I agree there is some inconsistency that could be cleaned up among the LGTM products, but this issue is purely a bug in this one template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 area/helm type/bug Somehing is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants