kuberneteskubernetes-helmcicd

How to pass brackets and other special characters using —set in Helm


I’m trying to run helm install using —set or —set-string to pass a value that includes brackets and a hyphen, to be precise I am trying to pass this:

—-set myapp.env.JAVA_TOOL_OPTS=“-Dmyarg=$(MYARGVALUE)”

MYARGVALUE is a different environment variable that I am referencing but I want the deployment to have the value as is in order for the substitution to work and I am unable to do so. I want to avoid using a values.yaml file to implement this, I want to pass this as an argument.

I tried single back slash, double and triple. Tried regular quotes, single quotes, both in different orders, and everything together in any combination possible and nothing was able to pass it.


Solution

  • Try using --set-literal instead of --set.

    This flag is used to set a specific string with no escaping, and is available from Helm v3.12.0.