Skip to content

Commit

Permalink
feat: area/helm: Modified helm template to use http_listen_port and g…
Browse files Browse the repository at this point in the history
…rpc_listen_port instead of hardcoded value (#11646)

Signed-off-by: Sheikh-Abubaker <[email protected]>
Co-authored-by: Alberto Chiusole <[email protected]>
Co-authored-by: Michel Hollands <[email protected]>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 4ce5fa8 commit 347fd4d
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 43 deletions.
4 changes: 4 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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.44.0

- [FEATURE] Modified helm template to use parameters http_listen_port and grpc_listen_port instead of hardcoded values.

## 5.43.7

- [BUGFIX] allow to configure http_config for ruler
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.4
version: 5.43.7
version: 5.44.0
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.43.7](https://img.shields.io/badge/Version-5.43.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.4](https://img.shields.io/badge/AppVersion-2.9.4-informational?style=flat-square)
![Version: 5.44.0](https://img.shields.io/badge/Version-5.44.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.4](https://img.shields.io/badge/AppVersion-2.9.4-informational?style=flat-square)

Helm chart for Grafana Loki in simple, scalable mode

Expand Down
14 changes: 7 additions & 7 deletions production/helm/loki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -567,10 +567,10 @@ Params:
service:
name: {{ $serviceName }}
port:
number: 3100
number: {{ .Values.loki.server.http_listen_port }}
{{- else }}
serviceName: {{ $serviceName }}
servicePort: 3100
servicePort: {{ .Values.loki.server.http_listen_port }}
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down Expand Up @@ -613,7 +613,7 @@ Create the service endpoint including port for MinIO.
{{- $isSingleBinary := eq (include "loki.deployment.isSingleBinary" .) "true" -}}
{{- $url := printf "%s.%s.svc.%s.:%s" (include "loki.gatewayFullname" .) .Release.Namespace .Values.global.clusterDomain (.Values.gateway.service.port | toString) }}
{{- if and $isSingleBinary (not .Values.gateway.enabled) }}
{{- $url = printf "%s.%s.svc.%s.:3100" (include "loki.singleBinaryFullname" .) .Release.Namespace .Values.global.clusterDomain }}
{{- $url = printf "%s.%s.svc.%s.:%s" (include "loki.singleBinaryFullname" .) .Release.Namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
{{- end }}
{{- printf "%s" $url -}}
{{- end -}}
Expand Down Expand Up @@ -726,9 +726,9 @@ http {
{{- $writeHost = include "loki.singleBinaryFullname" .}}
{{- end }}

{{- $writeUrl := printf "http://%s.%s.svc.%s:3100" $writeHost .Release.Namespace .Values.global.clusterDomain }}
{{- $readUrl := printf "http://%s.%s.svc.%s:3100" $readHost .Release.Namespace .Values.global.clusterDomain }}
{{- $backendUrl := printf "http://%s.%s.svc.%s:3100" $backendHost .Release.Namespace .Values.global.clusterDomain }}
{{- $writeUrl := printf "http://%s.%s.svc.%s:%s" $writeHost .Release.Namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
{{- $readUrl := printf "http://%s.%s.svc.%s:%s" $readHost .Release.Namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}
{{- $backendUrl := printf "http://%s.%s.svc.%s:%s" $backendHost .Release.Namespace .Values.global.clusterDomain (.Values.loki.server.http_listen_port | toString) }}

{{- if .Values.gateway.nginxConfig.customWriteUrl }}
{{- $writeUrl = .Values.gateway.nginxConfig.customWriteUrl }}
Expand Down Expand Up @@ -896,7 +896,7 @@ enableServiceLinks: false
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- $schedulerAddress := ""}}
{{- if and $isSimpleScalable (not .Values.read.legacyReadTarget ) -}}
{{- $schedulerAddress = printf "query-scheduler-discovery.%s.svc.%s.:9095" .Release.Namespace .Values.global.clusterDomain -}}
{{- $schedulerAddress = printf "query-scheduler-discovery.%s.svc.%s.:%s" .Release.Namespace .Values.global.clusterDomain (.Values.loki.server.grpc_listen_port | toString) -}}
{{- end -}}
{{- printf "%s" $schedulerAddress }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ spec:
publishNotReadyAddresses: true
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ spec:
clusterIP: None
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/backend/service-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ spec:
type: ClusterIP
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ spec:
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: 9095
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
- name: http-memberlist
containerPort: 7946
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Client definition for LogsInstance
*/}}
{{- define "loki.logsInstanceClient" -}}
{{- $isSingleBinary := eq (include "loki.deployment.isSingleBinary" .) "true" -}}
{{- $url := printf "http://%s.%s.svc.%s:3100/loki/api/v1/push" (include "loki.writeFullname" .) .Release.Namespace .Values.global.clusterDomain }}
{{- $url := printf "http://%s.%s.svc.%s:%s/loki/api/v1/push" (include "loki.writeFullname" .) .Release.Namespace .Values.global.clusterDomain .Values.loki.server.http_listen_port }}

This comment has been minimized.

Copy link
@lrascao

lrascao Mar 18, 2024

shouldn't this also be: (.Values.loki.server.grpc_listen_port | toString)?

{{- if $isSingleBinary }}
{{- $url = printf "http://%s.%s.svc.%s:3100/loki/api/v1/push" (include "loki.singleBinaryFullname" .) .Release.Namespace .Values.global.clusterDomain }}
{{- $url = printf "http://%s.%s.svc.%s:%s/loki/api/v1/push" (include "loki.singleBinaryFullname" .) .Release.Namespace .Values.global.clusterDomain .Values.loki.server.http_listen_port }}

This comment has been minimized.

Copy link
@lrascao

lrascao Mar 18, 2024

shouldn't this also be: (.Values.loki.server.grpc_listen_port | toString)

{{- else if .Values.gateway.enabled -}}
{{- $url = printf "http://%s.%s.svc.%s/loki/api/v1/push" (include "loki.gatewayFullname" .) .Release.Namespace .Values.global.clusterDomain }}
{{- end -}}
Expand Down
6 changes: 3 additions & 3 deletions production/helm/loki/templates/read/deployment-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ spec:
- -config.file=/etc/loki/config/config.yaml
- -target={{ .Values.read.targetModule }}
- -legacy-read-mode=false
- -common.compactor-grpc-address={{ include "loki.backendFullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}:9095
- -common.compactor-grpc-address={{ include "loki.backendFullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.global.clusterDomain }}:{{ .Values.loki.server.grpc_listen_port }}
{{- with .Values.read.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: 9095
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
- name: http-memberlist
containerPort: 7946
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ spec:
clusterIP: None
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
appProtocol: tcp
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/read/service-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ spec:
type: ClusterIP
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/read/statefulset-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ spec:
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: 9095
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
- name: http-memberlist
containerPort: 7946
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
clusterIP: None
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
selector:
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/single-binary/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ spec:
type: ClusterIP
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/single-binary/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ spec:
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: 9095
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
- name: http-memberlist
containerPort: 7946
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ spec:
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: 9095
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
{{- with .Values.tableManager.extraEnv }}
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ spec:
type: ClusterIP
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ spec:
clusterIP: None
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
appProtocol: tcp
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/write/service-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ spec:
type: ClusterIP
ports:
- name: http-metrics
port: 3100
port: {{ .Values.loki.server.http_listen_port }}
targetPort: http-metrics
protocol: TCP
- name: grpc
port: 9095
port: {{ .Values.loki.server.grpc_listen_port }}
targetPort: grpc
protocol: TCP
selector:
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/write/statefulset-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ spec:
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
containerPort: {{ .Values.loki.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: 9095
containerPort: {{ .Values.loki.server.grpc_listen_port }}
protocol: TCP
- name: http-memberlist
containerPort: 7946
Expand Down

0 comments on commit 347fd4d

Please sign in to comment.