Kubernetes - Reload your ASP.NET Core configuration when a configmap changes–DOTNET_USE_POLLING_FILE_WATCHER
In a previous post I showed how you can use ConfigMaps in Kubernetes. This allows you to update for example our appsettings.json without the need to upload a new container image and update our pods.
Sounds great! However there is one challenge with this approach. In Kubernetes a config map is mounted as a symlink, and .NET is not able to pick up changes applied to the original file by just knowing about the symlink. I mentioned some workarounds but an out-of-the-box solution was not available at that time.
DOTNET_USE_POLLING_FILE_WATCHER
Now a solution to the problem above is available through the DOTNET_USE_POLLING_FILE_WATCHER environment variable. By setting this value to “true” or “1”, we can instruct .NET to not use the default FileSystemWatcher but using a polling mechanism instead.
More information: dotnet watch