Kustomize and Helm: How to Handle Values Files in Overlay Structures?

0
19
Asked By CleverCactus77 On

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?

3 Answers

Answered By CodeMasterX On

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.

Answered By NinjaTaco123 On

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.

Answered By WittyMongoose42 On

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!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.