Skip to content

Commit

Permalink
gateway: fix crash on ipv4 only systems (#11722)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**: Loki Gateway pod crashes on
systems that only have IPv4 enabled since PR
#9510

**Which issue(s) this PR fixes**:
Fixes #9681

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [x] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [x] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [x] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [x] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)
- [x] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory.
[Example
PR](0d4416a)

---------

Signed-off-by: Pieter van der Giessen <pieter@pionative.com>
Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
  • Loading branch information
Pionerd and MichelHollands committed Jan 22, 2024
1 parent fda991c commit b32d993
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,15 @@ null
<td><pre lang="json">
null
</pre>
</td>
</tr>
<tr>
<td>gateway.nginxConfig.enableIPv6</td>
<td>bool</td>
<td>Enable listener for IPv6, disable on IPv4-only systems</td>
<td><pre lang="json">
true
</pre>
</td>
</tr>
<tr>
Expand Down
4 changes: 4 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Entries should include a reference to the pull request that introduced the chang
[//]: # (<AUTOMATED_UPDATES_LOCATOR> : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.)


## 5.41.8

- [BUGFIX] Fix gateway: add possibility to disable listening on ipv6 to prevent crash on ipv4-only system.

## 5.41.7

- [FEATURE] Add support to disable specific alert rules
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki in simple, scalable mode
type: application
appVersion: 2.9.3
version: 5.41.7
version: 5.41.8
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loki

![Version: 5.41.7](https://img.shields.io/badge/Version-5.41.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.3](https://img.shields.io/badge/AppVersion-2.9.3-informational?style=flat-square)
![Version: 5.41.8](https://img.shields.io/badge/Version-5.41.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.3](https://img.shields.io/badge/AppVersion-2.9.3-informational?style=flat-square)

Helm chart for Grafana Loki in simple, scalable mode

Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,9 @@ http {

server {
listen 8080;
{{- if .Values.gateway.nginxConfig.enableIPv6 }}
listen [::]:8080;
{{- end }}

{{- if .Values.gateway.basicAuth.enabled }}
auth_basic "Loki";
Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,8 @@ gateway:
initialDelaySeconds: 15
timeoutSeconds: 1
nginxConfig:
# -- Enable listener for IPv6, disable on IPv4-only systems
enableIPv6: true
# -- NGINX log format
logFormat: |-
main '$remote_addr - $remote_user [$time_local] $status '
Expand Down

0 comments on commit b32d993

Please sign in to comment.