Replies: 3 comments
-
|
Hello there, @mcdolding! 👋🏻 Currently, it's possible to add YAML file contents to a Kustomization using the where your server:
port: 8080you could use apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- files:
- application.yaml
name: test-cm
namespace: test-nswhich would then generate the following structure on apiVersion: v1
data:
application.yaml: |
server:
port: 8080
kind: ConfigMap
metadata:
name: test-cm-bd9fg9hb5h
namespace: test-nsIt's also possible to override the YAML key when using apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
- files:
- test.yaml=application.yaml
name: test-cm
namespace: test-nswhich then results in: apiVersion: v1
data:
test.yaml: |
server:
port: 8080
kind: ConfigMap
metadata:
name: test-cm-d76c2hh757
namespace: test-nsDoes that address your use case? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your detailed response. This is exactly what I need. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @stormqueen1990 , do you know if there is an easy way to write application.yaml files like this and from them generate configmaps like this: My use case is to be able to compose/override values in these application.yaml files. If you have everything in one big file, you can't selectively add/override values. Instead, if you have everything as one key in the configmap, you can mount this as a configtree and spring knows how to read them in the same way as one big file. And so you can use One alternative is to mount many big application.yaml files and rely on spring's order of precedence (usually with a wildcard like /config/* you get alphabetical order precedence) but I always find this not practical because each application.yaml needs to be in its own folder. Spring documentation on its configuration: https://docs.spring.io/spring-boot/reference/features/external-config.html Maybe you have more insight on this topic ? TIA, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The configMapGenerator will manage a configmap using properties of the form myproperty=myvalue.
However I have springboot and quarkus applications which are configured using application.yml files (in place of application.properties files). At runtime we provide configmaps of the form:
Would it be possible to extend configMapGenerator to handle yml properties?
Beta Was this translation helpful? Give feedback.
All reactions