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
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
17 changes: 3 additions & 14 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 @@ -473,23 +474,11 @@ enterprise:
# make sure auth is set to `type: trust`, or that `auth_enabled` is set to `false`.
adminApi:
enabled: true
# -- Storage configuration for GEL Admin objects
adminClientConfig: |
{{ if .Values.minio.enabled }}
storage:
s3:
endpoint: {{ include "loki.minio" $ }}
bucket_name: admin
secret_access_key: {{ $.Values.minio.rootPassword }}
access_key_id: {{ $.Values.minio.rootUser }}
s3forcepathstyle: true
insecure: true
{{ end }}
# enterprise specific sections of the config.yaml file
config: |
{{- if .Values.enterprise.adminApi.enabled }}
admin_client:
{{ tpl .Values.enterprise.adminClientConfig . | nindent 2 }}
admin_client:
{{ include "enterprise-logs.adminAPIStorageConfig" . | nindent 2 }}
{{ end }}
auth:
type: {{ .Values.enterprise.adminApi.enabled | ternary "enterprise" "trust" }}
Expand Down