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
5 changes: 3 additions & 2 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,7 @@ null
},
"canarySecret": null,
"cluster_name": null,
"config": "{{- if .Values.enterprise.adminApi.enabled }}\n{{- if or .Values.minio.enabled (eq .Values.loki.storage.type \"s3\") (eq .Values.loki.storage.type \"gcs\") (eq .Values.loki.storage.type \"azure\") }}\nadmin_client:\n storage:\n s3:\n bucket_name: admin\n{{- end }}\n{{- end }}\nauth:\n type: {{ .Values.enterprise.adminApi.enabled | ternary \"enterprise\" \"trust\" }}\nauth_enabled: {{ .Values.loki.auth_enabled }}\ncluster_name: {{ include \"loki.clusterName\" . }}\nlicense:\n path: /etc/loki/license/license.jwt\n",
"config": "{{- if .Values.enterprise.adminApi.enabled }}\nadmin_client:\n {{ include \"enterprise-logs.adminAPIStorageConfig\" . | nindent 2 }}\n{{ end }}\nauth:\n type: {{ .Values.enterprise.adminApi.enabled | ternary \"enterprise\" \"trust\" }}\nauth_enabled: {{ .Values.loki.auth_enabled }}\ncluster_name: {{ include \"loki.clusterName\" . }}\nlicense:\n path: /etc/loki/license/license.jwt\n",
"enabled": false,
"externalConfigName": "",
"externalLicenseName": null,
Expand Down Expand Up @@ -2630,7 +2630,7 @@ null
"tolerations": []
},
"useExternalLicense": false,
"version": "v3.0.1"
"version": "3.0.1"
}
</pre>
</td>
Expand Down Expand Up @@ -5594,6 +5594,7 @@ null
"userAssignedId": null
},
"filesystem": {
"admin_api_directory": "/var/loki/admin",
"chunks_directory": "/var/loki/chunks",
"rules_directory": "/var/loki/rules"
},
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
name: loki
description: Helm chart for Grafana Loki in simple, scalable mode
description: Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
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
4 changes: 2 additions & 2 deletions production/helm/loki/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# loki

![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)
![Version: 6.5.1](https://img.shields.io/badge/Version-6.5.1-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:
bucket_name: admin
{{- else if eq .Values.loki.storage.type "s3" -}}
{{- with .Values.loki.storage.s3 }}
backend: "s3"
s3:
bucket_name: {{ $.Values.loki.storage.bucketNames.admin }}
{{- 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
11 changes: 4 additions & 7 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 }}
{{ include "enterprise-logs.adminAPIStorageConfig" . | nindent 2 }}
{{ end }}
auth:
type: {{ .Values.enterprise.adminApi.enabled | ternary "enterprise" "trust" }}
auth_enabled: {{ .Values.loki.auth_enabled }}
Expand Down
Loading