How to export environment variable by the start up script of the pod

Viewed 663

I am trying to create the environment variable using the startup script inside the initcontainer of the pod like below

 initContainers:
   - name: init-myservice
     image: ubuntu
     command: ["/bin/sh","-c"]
     args: [". /a/b/Exporter.sh"]

and Exporter.sh script has the below line in it

export JOBID=$temp

But when script is executed successfully and I go and check for the environment variable exported by the script in another pod, environment variable is not present in another pod. How to solve this problem?

0 Answers
Related