Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
kind: ConfigMap
apiVersion: v1
metadata:
name: example-configmap
data:
# Configuration values can be set as key-value properties
database: mongodb
database_uri: mongodb://localhost:27017
# Or set as complete file contents (even JSON!)
keys: |
image.public.key=771
rsa.public.key=42
@coolzsatyen
Copy link

coolzsatyen commented May 18, 2022

Hello Matthew, excellent article. I have a doubt on an approach.
I have an appsetting.json file which contains few array of object configurations like below:
... "Admin": [ { "AdminNumber": "J1YLihpUs=", "AdminKey": "123" }, { "AdminNumber": "LyU3gtB7HXZqKgy=", "AdminKey": "456" } ], ...

But tomorrow lets say, another AdminNumber & AdminKey is added in future as an requirement then I don't want to change in appsetting.json and then make code change and deploy. Rather make changes in YAML file at runtime during release pipeline.

So, can you suggest to use the same using YAML > ConfigMap. I have written below but this is breaking while building in pipelines.

apiVersion: v1 kind: ConfigMap metadata: name: admin-test data: Admin: - "AdminNumber": "J1YLihpUs=" "AdminKey": "123" - "AdminNumber": "LyU3gtB7HXZqKgy=" "AdminKey": "456" "Logging__LogLevel__Default": "Debug"

What is wrong in above YAML file ? Why can't I use Array of objects inside a "Type: Data" ? Or is there any better way ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment