I have this scenario in my spring boot yaml file:
This way I'm able to load the properties in config file to memory.
Now I need to apply this same configuration to my config map kubernetes file.
I have found this example in kubernetes official documentation, but is different from what a I need.
https://kubernetes.io/docs/concepts/configuration/configmap/#configmaps-and-pods
Are there some way to apply the configuration in config map as is in my first image ?
Yes, of course - use your application.yaml as input.
kubectl create configmap demo --from-file application.yaml
You can mount the file in a container again as application.yaml
and you're done.
The generated configmap looks like this:
apiVersion: v1
kind: ConfigMap
data:
application.yaml: |+
my-company:
kafka:
some-propery-1: 10
topics:
- foo: bar
By the way: Please don't post screenshots with code, this makes the content inaccessible to screen readers and search engines.