Templating configmap (or string in general) in tanka #635
Replies: 3 comments
-
Also looking for a way to replace vars in data/text. I am currently trying to do sth like the following, but it seems the $._config.realm is not available...
|
Beta Was this translation helpful? Give feedback.
-
For supported structured file format in jsonnet (like yaml, json or ini), I found that one can template string in them by using the std lib. For example:
|
Beta Was this translation helpful? Give feedback.
-
Oh after some time testing and debugging some formatting problems with json contained in yaml i came up with this one which seems easier for the eyes: ;)
|
Beta Was this translation helpful? Give feedback.
-
Jsonnet supports for deep merging is great for overriding values, but I haven't been able to find an up-to-date resource for templating string. For example, I'm trying to template a default loki deployment configmap for grafana agent with username and password:
There are some methods for templating text file in the old ksonnet documentation and current jsonnet documentation using Python-compatible string formatting with %, but it's rather unwieldy if the string have more than a few variables. I was wondering if there are better approach to string templating, or at least with structured yaml or json in configmap.
Beta Was this translation helpful? Give feedback.
All reactions