4

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?

David Maze
  • 130,717
  • 29
  • 175
  • 215
Katlock
  • 1,200
  • 1
  • 17
  • 41
  • Is `$POSTGRES_DBNAME` available on the machine you are executing the helm command? Or is it in the container? If the first, then you can try to cook something up following this answer https://stackoverflow.com/questions/49928819/how-to-pull-environment-variables-with-helm-charts Generally speaking all related config should be part of the helm release (gitops/ioc), so without knowing your case I will say to reexamining your use case. – Filip Nikolov Oct 19 '20 at 15:12

1 Answers1

3

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.

Adiii
  • 54,482
  • 7
  • 145
  • 148