Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add env directive to values.yaml and troubleshooting guide to avoid inotify limitation on Linux #544

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions casdk-docs/docs/overview/enablement.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ tolerations: []

affinity: {}

env: []

# appsettings.json
appsettings: |-
{
Expand Down
25 changes: 25 additions & 0 deletions casdk-docs/docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
sidebar_position: 10
---

# Troubleshooting guide

This chapter shows the hint of troubleshooting if you face trouble(s) when you use Carbon Aware SDK.

- [System.IO.IOException caused by number of inotify instances](#systemioioexception-caused-by-number-of-inotify-instances)

## System.IO.IOException caused by number of inotify instances

You could see `System.IO.IOException` caused by number of inotify instances when you run Carbon Aware SDK on Linux.

.NET runtime uses inotify to watch updating configuration file (e.g. `appsettings.json`). See [Microsoft Lean](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/?view=aspnetcore-8.0) and [discussion on GitHub](https://github.com/dotnet/AspNetCore.Docs/issues/19814) for details.

It is useful for debugging, but it would not be needed in most of production system. So you can disable this feature via environment variable.

You need to set `DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE=false` to avoid the problem. You can set this in `values.yaml` as following when you deploy WebAPI via Helm chart.

```yaml
env:
- name: DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE
value: "false"
```
2 changes: 1 addition & 1 deletion helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.0
version: 1.2.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
{{- with .Values.image.pullPolicy }}
imagePullPolicy: {{ . }}
{{- end }}
env:
{{- toYaml .Values.env | nindent 12 }}
ports:
- name: http
containerPort: 8080
Expand Down
2 changes: 2 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ tolerations: []

affinity: {}

env: []

# /app/appsettings.json
appsettings: |-
{
Expand Down
Loading