.sh script execution

Hi All,
I have a simple question that won’t require any yaml, I want to change some links inside my application for this i have made a script that will replace them with the env. variable of my configMap ,but i have to manually go into my pod everytime it start’s up . How can i automate the workflow so that the script will execute itself on pods startup. I don’t want to use kubectl exec cmd everytime on pod startup.
any help will be appreciated .

Rahul

There are usually middle wares your app can use and will do that automatically when starting the app, or just read them from env variables in the pod.

If you can’t use that and want to run two commands on startup (I’d really encourage you to look at the other way just suggested, though) you can create a bash script that does something like:

run command for your .env file

exec

(Nota that exec in bash is being used, it replaces the bash script with your program without creating a new process)