How do I create an environment variable inside my config map, so I can set the env variable to be equal to a kubectl command

Hard without any real details of your use-case. It might be as simple as:

entrypoint.sh:

cat input.conf.tmpl | sed -e "s/{{VARIABLE_NAME}}/${VARIABLE_NAME}/g" > real.conf
exec "$@"