Created
February 5, 2019 20:45
-
-
Save matthewpalmer/33016359f49c88acc12e86eda232f14a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ?