Advertisement
Guest User

Untitled

a guest
Jul 19th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. To get the result you want you need a “define” like that somewhere in your templates:
  2.  
  3. {{- define “GetEnv” }}
  4. {{- $name := index . 0 }}
  5. {{- $ := index . 1 }}
  6. // Here try to find $name in $.Values.env first, then fall back to $.Values.tiers (or vice versa)
  7. {{- end }}
  8.  
  9. And config.cfg should look like that:
  10.  
  11. NAME={{ include “var1” $ }}
  12. SURNAME={{ include “var2” $ }}
  13. JOB={{ include “var3” $ }}
  14.  
  15. Now include config.cfg in one of your templates:
  16.  
  17. kind: ConfigMap
  18. data: {{ include “config.cfg” $ | nindent 2 }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement