Kustomize and Helm: How to Handle Values Files in Overlay Structures?
Asked by
_240 thread count
I'm working with Kustomize and Helm for deploying the kube-prometheus-stack, and I'm running into a frustrating issue with file reference paths. My project's folder structure includes a 'base' directory and several overlays (like 'dev' and 'production'). However, when I try to reference a values file located in the base directory from my overlay, I get an error due to security restrictions. Specifically, the error indicates that the path to the values file isn't acceptable because it's going above my overlay directory. I want to avoid duplicating files, restructuring my directories, or making any significant changes to my setup, so I'm looking for a way to refer to the values file without running into this issue. Any advice or workarounds?
Answers
Correct me if I'm wrong, but if you're moving your helmCharts config to the base/kustomization.yaml, how do you plan to ensure that additional values (like values-kind.yaml) are only triggered for KinD? It sounds tricky to manage!
Reply to this answer
You might want to check out disabling the security feature causing this restriction. It's usually added to prevent issues, but in your case, it seems like itโs a hindrance. Just make sure you're aware of the risks involved if you choose to go that route.
Reply to this answer
The limitation you're facing is indeed a security measure that restricts referencing files outside the Kustomize directory structure. A potential workaround is to create a new kustomization.yaml file in the folder with your base values. Reference this new kustomization file in your original one, and include the values file there as a resource. That way, you should be able to manage your values while staying within the rules.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions