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

fix(helm): Fix GEL image tag, bucket name and proxy URLs #12878

Merged
merged 11 commits into from
May 8, 2024
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: 3.0.0
version: 6.5.0
version: 6.5.1
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
Expand Up @@ -2,7 +2,7 @@

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

Helm chart for Grafana Loki in simple, scalable mode
Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.

## Source Code

Expand Down
76 changes: 76 additions & 0 deletions production/helm/loki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,82 @@ ruler:
{{- end }}
{{- end }}

{{/* Enterprise Logs Admin API storage config */}}
{{- define "enterprise-logs.adminAPIStorageConfig" }}
storage:
{{- if .Values.minio.enabled }}
backend: "s3"
s3:
bucketnames: admin
{{- else if eq .Values.loki.storage.type "s3" -}}
{{- with .Values.loki.storage.s3 }}
backend: "s3"
s3:
bucketnames: {{ $.Values.loki.storage.bucketNames.admin }}
vlad-diachenko marked this conversation as resolved.
Show resolved Hide resolved
{{- end -}}
{{- else if eq .Values.loki.storage.type "gcs" -}}
{{- with .Values.loki.storage.gcs }}
backend: "gcs"
gcs:
bucket_name: {{ $.Values.loki.storage.bucketNames.admin }}
{{- end -}}
{{- else if eq .Values.loki.storage.type "azure" -}}
{{- with .Values.loki.storage.azure }}
backend: "azure"
azure:
account_name: {{ .accountName }}
{{- with .accountKey }}
account_key: {{ . }}
{{- end }}
{{- with .connectionString }}
connection_string: {{ . }}
{{- end }}
container_name: {{ $.Values.loki.storage.bucketNames.admin }}
{{- with .endpointSuffix }}
endpoint_suffix: {{ . }}
{{- end }}
{{- end -}}
{{- else if eq .Values.loki.storage.type "swift" -}}
{{- with .Values.loki.storage.swift }}
backend: "swift"
swift:
{{- with .auth_version }}
auth_version: {{ . }}
{{- end }}
auth_url: {{ .auth_url }}
{{- with .internal }}
internal: {{ . }}
{{- end }}
username: {{ .username }}
user_domain_name: {{ .user_domain_name }}
{{- with .user_domain_id }}
user_domain_id: {{ . }}
{{- end }}
{{- with .user_id }}
user_id: {{ . }}
{{- end }}
password: {{ .password }}
{{- with .domain_id }}
domain_id: {{ . }}
{{- end }}
domain_name: {{ .domain_name }}
project_id: {{ .project_id }}
project_name: {{ .project_name }}
project_domain_id: {{ .project_domain_id }}
project_domain_name: {{ .project_domain_name }}
region_name: {{ .region_name }}
container_name: {{ .container_name }}
max_retries: {{ .max_retries | default 3 }}
connect_timeout: {{ .connect_timeout | default "10s" }}
request_timeout: {{ .request_timeout | default "5s" }}
{{- end -}}
{{- else }}
backend: "filesystem"
filesystem:
dir: {{ .Values.loki.storage.filesystem.admin_api_directory }}
{{- end -}}
{{- end }}

{{/*
Calculate the config from structured and unstructured text input
*/}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- $isSimpleScalable := eq (include "loki.deployment.isScalable" .) "true" -}}
{{- if and .Values.gateway.enabled .Values.enterprise.enabled .Values.enterprise.gelGateway }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -69,14 +71,24 @@ spec:
- -admin.client.s3.secret-access-key={{ .Values.minio.secretKey }}
- -admin.client.s3.insecure=true
{{- end }}
{{- if .Values.enterpriseGateway.useDefaultProxyURLs }}
{{- if and $isDistributed .Values.enterpriseGateway.useDefaultProxyURLs }}
- -gateway.proxy.default.url=http://{{ template "loki.fullname" . }}-admin-api.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.admin-api.url=http://{{ template "loki.fullname" . }}-admin-api.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.distributor.url=dns:///{{ template "loki.fullname" . }}-distributor-headless.{{ .Release.Namespace }}.svc:9095
- -gateway.proxy.ingester.url=http://{{ template "loki.fullname" . }}-ingester.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.query-frontend.url=http://{{ template "loki.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.ruler.url=http://{{ template "loki.fullname" . }}-ruler.{{ .Release.Namespace }}.svc:3100
{{- end }}
{{- if and $isSimpleScalable .Values.enterpriseGateway.useDefaultProxyURLs }}
- -gateway.proxy.default.url=http://{{ template "enterprise-logs.adminApiFullname" . }}.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.admin-api.url=http://{{ template "enterprise-logs.adminApiFullname" . }}.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.compactor.url=http://{{ template "loki.backendFullname" . }}-headless.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.distributor.url=dns:///{{ template "loki.writeFullname" . }}-headless.{{ .Release.Namespace }}.svc:9095
- -gateway.proxy.ingester.url=http://{{ template "loki.writeFullname" . }}.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.query-frontend.url=http://{{ template "loki.readFullname" . }}.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.ruler.url=http://{{ template "loki.backendFullname" . }}-headless.{{ .Release.Namespace }}.svc:3100
- -gateway.proxy.query-scheduler.url=http://{{ template "loki.backendFullname" . }}-headless.{{ .Release.Namespace }}.svc:3100
{{- end }}
{{- range $key, $value := .Values.enterpriseGateway.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
Expand Down
13 changes: 5 additions & 8 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ loki:
filesystem:
chunks_directory: /var/loki/chunks
rules_directory: /var/loki/rules
admin_api_directory: /var/loki/admin
# -- Configure memcached as an external cache for chunk and results cache. Disabled by default
# must enable and specify a host for each cache you would like to use.
memcached:
Expand Down Expand Up @@ -449,7 +450,7 @@ enterprise:
# Enable enterprise features, license must be provided
enabled: false
# Default verion of GEL to deploy
version: v3.0.1
version: 3.0.1
# -- Optional name of the GEL cluster, otherwise will use .Release.Name
# The cluster name must match what is in your GEL license
cluster_name: null
Expand All @@ -476,13 +477,9 @@ enterprise:
# enterprise specific sections of the config.yaml file
config: |
{{- if .Values.enterprise.adminApi.enabled }}
{{- if or .Values.minio.enabled (eq .Values.loki.storage.type "s3") (eq .Values.loki.storage.type "gcs") (eq .Values.loki.storage.type "azure") }}
admin_client:
storage:
s3:
bucket_name: admin
{{- end }}
{{- end }}
admin_client:
{{ include "enterprise-logs.adminAPIStorageConfig" . | nindent 2 }}
{{ end }}
auth:
type: {{ .Values.enterprise.adminApi.enabled | ternary "enterprise" "trust" }}
auth_enabled: {{ .Values.loki.auth_enabled }}
Expand Down