Files
HetznerTerra/infrastructure/charts/loki/templates/gateway/deployment-gateway-enterprise.yaml
T

158 lines
7.8 KiB
YAML
Raw Normal View History

2026-05-04 10:49:46 +00:00
{{- $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
metadata:
name: {{ template "loki.gatewayFullname" . }}
namespace: {{ include "loki.namespace" . }}
labels:
{{- include "loki.gatewayLabels" . | nindent 4 }}
{{- with .Values.enterpriseGateway.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- with .Values.enterpriseGateway.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.enterpriseGateway.replicas }}
selector:
matchLabels:
{{- include "loki.gatewaySelectorLabels" . | nindent 6 }}
strategy:
{{- toYaml .Values.enterpriseGateway.strategy | nindent 4 }}
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
template:
metadata:
labels:
{{- include "loki.gatewaySelectorLabels" . | nindent 8 }}
{{- with .Values.enterpriseGateway.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- if .Values.useExternalConfig }}
checksum/config: {{ .Values.externalConfigVersion }}
{{- else }}
checksum/config: {{ include "loki.configMapOrSecretContentHash" (dict "ctx" . "name" "/config.yaml") }}
{{- end}}
{{- with .Values.enterpriseGateway.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" (include "loki.kubeVersion" .) }}
{{- with .Values.enterpriseGateway.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl ( . | toYaml) $ | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ template "loki.serviceAccountName" . }}
{{- if .Values.enterpriseGateway.priorityClassName }}
priorityClassName: {{ .Values.enterpriseGateway.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.enterpriseGateway.podSecurityContext | nindent 8 }}
initContainers:
{{- toYaml .Values.enterpriseGateway.initContainers | nindent 8 }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseGateway.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if and (semverCompare ">=1.33-0" (include "loki.kubeVersion" .)) (kindIs "bool" .Values.enterpriseGateway.hostUsers) }}
hostUsers: {{ .Values.enterpriseGateway.hostUsers }}
{{- end }}
containers:
- name: gateway
image: "{{ template "loki.image" . }}"
imagePullPolicy: {{ .Values.enterprise.image.pullPolicy }}
args:
- -target=gateway
- -config.file=/etc/loki/config/config.yaml
{{- if .Values.minio.enabled }}
- -admin.client.backend-type=s3
- -admin.client.s3.endpoint={{ template "loki.minio" . }}
- -admin.client.s3.bucket-name={{ .Values.loki.storage.bucketNames.admin }}
- -admin.client.s3.access-key-id={{ (index .Values.minio.users 0).accessKey }}
- -admin.client.s3.secret-access-key={{ (index .Values.minio.users 0).secretKey }}
- -admin.client.s3.insecure={{ .Values.loki.storage.s3.insecure }}
{{- end }}
{{- if and $isDistributed .Values.enterpriseGateway.useDefaultProxyURLs }}
- -gateway.proxy.default.url=http://{{ template "loki.fullname" . }}-admin-api.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.admin-api.url=http://{{ template "loki.fullname" . }}-admin-api.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.distributor.url=dns:///{{ template "loki.fullname" . }}-distributor-headless.{{ include "loki.namespace" . }}.svc:9095
- -gateway.proxy.ingester.url=http://{{ template "loki.fullname" . }}-ingester.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.query-frontend.url=http://{{ template "loki.fullname" . }}-query-frontend.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.ruler.url=http://{{ template "loki.fullname" . }}-ruler.{{ include "loki.namespace" . }}.svc:3100
{{- end }}
{{- if and $isSimpleScalable .Values.enterpriseGateway.useDefaultProxyURLs }}
- -gateway.proxy.default.url=http://{{ template "loki.backendFullname" . }}.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.admin-api.url=http://{{ template "loki.backendFullname" . }}.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.compactor.url=http://{{ template "loki.backendFullname" . }}-headless.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.distributor.url=dns:///{{ template "loki.writeFullname" . }}-headless.{{ include "loki.namespace" . }}.svc:9095
- -gateway.proxy.ingester.url=http://{{ template "loki.writeFullname" . }}.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.query-frontend.url=http://{{ template "loki.readFullname" . }}.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.ruler.url=http://{{ template "loki.backendFullname" . }}-headless.{{ include "loki.namespace" . }}.svc:3100
- -gateway.proxy.query-scheduler.url=http://{{ template "loki.backendFullname" . }}-headless.{{ include "loki.namespace" . }}.svc:3100
{{- end }}
{{- range $key, $value := .Values.enterpriseGateway.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/loki/config
- name: license
mountPath: /etc/loki/license
- name: storage
mountPath: /data
{{- if .Values.enterpriseGateway.extraVolumeMounts }}
{{ toYaml .Values.enterpriseGateway.extraVolumeMounts | nindent 12 }}
{{- end }}
ports:
- name: http-metrics
containerPort: 3100
protocol: TCP
readinessProbe:
{{- toYaml .Values.enterpriseGateway.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.enterpriseGateway.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.enterpriseGateway.containerSecurityContext | nindent 12 }}
env:
{{- if .Values.enterpriseGateway.env }}
{{ toYaml .Values.enterpriseGateway.env | nindent 12 }}
{{- end }}
{{- with .Values.enterpriseGateway.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.enterpriseGateway.extraContainers }}
{{ toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
{{- toYaml .Values.enterpriseGateway.nodeSelector | nindent 8 }}
affinity:
{{- tpl (.Values.enterpriseGateway.affinity | toYaml) . | nindent 8 }}
tolerations:
{{- toYaml .Values.enterpriseGateway.tolerations | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.enterpriseGateway.terminationGracePeriodSeconds }}
volumes:
- name: config
{{- include "loki.configVolume" . | nindent 10 }}
- name: license
secret:
{{- if .Values.enterprise.useExternalLicense }}
secretName: {{ .Values.enterprise.externalLicenseName }}
{{- else }}
secretName: enterprise-logs-license
{{- end }}
- name: storage
emptyDir: {}
{{- if .Values.enterpriseGateway.extraVolumes }}
{{ toYaml .Values.enterpriseGateway.extraVolumes | nindent 8 }}
{{- end }}
{{- end }}