Using Configmaps , I am attaching a text file containing environment variables to a Pod . When I log in to the POD and then run "env" command , I am able to see like below
env.txt=var1=123
var2=30000
I am trying to read var1 or var2 . I am unable to do it .
Appreciate your help
As @RyanDawson answered in comments, you can proceed in two ways:
Put variables directly to a ConfigMap. After that you can mount them to Pods. Here are some examples: link-1 and link-2
Put variables into a file, and put the file into a ConfigMap. Mount the ConfigMap to a Pod, and after that use some script to parse it and add variables. Examples: link-3 and link-4