How to reference other environment variables in a Helm values file?

Viewed 580

I have a Helm values with content like following:

envs:
 - name: PACT_BROKER_DATABASE_NAME
   value: $POSTGRES_DBNAME

I want to reference another variable called $POSTGRES_DB_NAME and feed into that PACT_BROKER_DATABASE_NAME. The current value does not work. How do I feed one value to another variable?

1 Answers

I was looking for something to "reference another variable" in the helm variable section, google landed me here, posting as an answer, might help someone else.

I was looking for away to set heap allocation base on pod limit.

          env:
            - name: MEMORY_LIMIT
              valueFrom:
                resourceFieldRef:
                  resource: limits.memory
            - name: NODE_OPTIONS
              value: "--max-old-space-size=$(MEMORY_LIMIT)"

so I just need $(MEMORY_LIMIT)", so $POSTGRES_DBNAME this should be define in the same pod/container env.

Related