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.json
to 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.json
file to another folder then root? Is there something about not mapping the running application to a volume?
- Update the containers environment variables to override settings.
- Will these settings be reverted back when the container is restarted?)
Any other ideas?
question from:
https://stackoverflow.com/questions/65916977/changing-configuration-of-net-core-application-running-on-kubernetes 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…