Because I am new in the devops, I don't know where I need to apply the changes to run correct the project.

The structure:

git -> Jenkins -> docker build -> Kubernetes ( deploy ) 

Is better to make the change of variables in the project, (example: password,db connection,..) to the jenkins, kubernetes or docker ?

Example:

With docker-compose I use an environment variable to change the variable inside my code.

    environment:
      MONGO_INITDB_ROOT_USERNAME: user
      MONGO_INITDB_ROOT_PASSWORD: user

I Want to change this variable and run correctly in the production environment. 

I don't know where is the best to change the variable, Jenkins,kubernetes with ansible,... 

Regards,