I have a ASP.NET Core Worker Service which gets some information like thread count, batch size etc. from appsettings.json. These settings will only take affect on startup and cannot be change when the service is running.
The application will be running in a kubernetes cluster.
What is the best practice for changing these settings while deployed in production? What I need to have done is, changing the settings and restart the service.
I can come up with these solution:
- Mapping
appsetttings.jsonto a volume, to be able to change it, so that when container is restarted the appsettings is not reverted.- Do I need to move the
appsettings.jsonfile to another folder then root? Is there something about not mapping the running application to a volume?
- Do I need to move the
- Update the containers environment variables to override settings.
- Will these settings be reverted back when the container is restarted?)
Any other ideas?