I am a newbie to kubernetes and I have to implement kubernetes secrets for existing configmaps with passwords hardcorded.
I have 2 configmaps for each pod, 1 settings.yaml and other settings_override.yaml. I have to make override file read environment variables where I have kept base64 secrets. I have created secrets and can see them in pods after printenv.
Kindly suggest me how can I make my settings_override.yaml file read these environment secrets.
Note: if I just remove the key:value pair from settings_override.yaml file then it is picking value from settings.yaml but not from my env variable.
Settings and setting_override file for reference:
apiVersion: v1
data: setting.json: | {
"test": {
"testpswd": "test123",
"testPort": "123",
},
}
apiVersion: v1
data: setting_override.json: | {
"test": {
"testpswd": "test456",
"testPort": "456",
},
}
settings.yamlandsettings_override.yamlfor better understanding, remove anything which is confidential. - Here_2_learnapiVersion: v1 data: setting.json: | { "test": { "testpswd": "test123", "testPort": "123", }, }***********************************************************apiVersion: v1 data: setting.override.json: | { "test": { "testpswd": "test456", "testPort": "456", }, }For settings_override file , i have created test_testpswd and test_testport as env variable. I want to remove these hardcoded values but unfortnately its not picking the env variable but taking values from setting file. - Anu Thakur