-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a25f5f
commit eb184ee
Showing
4 changed files
with
382 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
production/helm/loki/templates/bloomfilters/_helpers-bloom-gateway.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{{/* | ||
bloom gateway fullname | ||
*/}} | ||
{{- define "loki.bloomGatewayFullname" -}} | ||
{{ include "loki.name" . }}-bloom-gateway | ||
{{- end }} | ||
|
||
{{/* | ||
bloom gateway common labels | ||
*/}} | ||
{{- define "loki.bloomGatewayLabels" -}} | ||
{{ include "loki.labels" . }} | ||
app.kubernetes.io/component: bloom-gateway | ||
{{- end }} | ||
|
||
{{/* | ||
bloom gateway selector labels | ||
*/}} | ||
{{- define "loki.bloomGatewaySelectorLabels" -}} | ||
{{ include "loki.selectorLabels" . }} | ||
app.kubernetes.io/component: bloom-gateway | ||
{{- end }} | ||
|
||
{{/* | ||
bloom gateway readinessProbe | ||
*/}} | ||
{{- define "loki.bloomGateway.readinessProbe" -}} | ||
{{- with .Values.bloomGateway.readinessProbe }} | ||
readinessProbe: | ||
{{- toYaml . | nindent 2 }} | ||
{{- else }} | ||
{{- with .Values.loki.readinessProbe }} | ||
readinessProbe: | ||
{{- toYaml . | nindent 2 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{/* | ||
bloom gateway priority class name | ||
*/}} | ||
{{- define "loki.bloomGatewayPriorityClassName" }} | ||
{{- $pcn := coalesce .Values.global.priorityClassName .Values.bloomGateway.priorityClassName -}} | ||
{{- if $pcn }} | ||
priorityClassName: {{ $pcn }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the bloom gateway service account | ||
*/}} | ||
{{- define "loki.bloomGatewayServiceAccountName" -}} | ||
{{- if .Values.bloomGateway.serviceAccount.create -}} | ||
{{ default (print (include "loki.serviceAccountName" .) "-bloom-gateway") .Values.bloomGateway.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default (include "loki.serviceAccountName" .) .Values.bloomGateway.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
37 changes: 37 additions & 0 deletions
37
production/helm/loki/templates/bloomfilters/service-bloom-compactor-headless.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if $isDistributed }} | ||
{{- if (eq .Values.loki.useBloomFilters true) -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "loki.bloomCompactorFullname" . }}-headless | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomCompactorLabels" . | nindent 4 }} | ||
{{- with .Values.bloomCompactor.serviceLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.loki.serviceAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
clusterIP: None | ||
ports: | ||
- name: http-metrics | ||
port: 3100 | ||
targetPort: http-metrics | ||
protocol: TCP | ||
- name: grpc | ||
port: 9095 | ||
targetPort: grpc | ||
protocol: TCP | ||
{{- if .Values.bloomCompactor.appProtocol.grpc }} | ||
appProtocol: {{ .Values.bloomCompactor.appProtocol.grpc }} | ||
{{- end }} | ||
selector: | ||
{{- include "loki.bloomCompactorSelectorLabels" . | nindent 4 }} | ||
name: bloom-compactor | ||
rollout-group: bloom-compactor | ||
{{- end -}} | ||
{{- end -}} |
179 changes: 179 additions & 0 deletions
179
production/helm/loki/templates/bloomfilters/statefulset-bloom-gateway.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if $isDistributed }} | ||
{{- if (eq .Values.loki.useBloomFilters true) -}} | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "loki.bloomGatewayFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomGatewayLabels" . | nindent 4 }} | ||
{{- with .Values.loki.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ .Values.bloomGateway.replicas }} | ||
podManagementPolicy: Parallel | ||
updateStrategy: | ||
rollingUpdate: | ||
partition: 0 | ||
serviceName: {{ include "loki.bloomGatewayFullname" . }}-headless | ||
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} | ||
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.bloomGateway.persistence.enableStatefulSetAutoDeletePVC) }} | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: {{ .Values.bloomGateway.persistence.whenDeleted }} | ||
whenScaled: {{ .Values.bloomGateway.persistence.whenScaled }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- include "loki.bloomGatewaySelectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- include "loki.config.checksum" . | nindent 8 }} | ||
{{- with .Values.loki.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "loki.bloomGatewaySelectorLabels" . | nindent 8 }} | ||
app.kubernetes.io/part-of: memberlist | ||
{{- with .Values.loki.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "loki.serviceAccountName" . }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.hostAliases }} | ||
hostAliases: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- include "loki.bloomGatewayPriorityClassName" . | nindent 6 }} | ||
securityContext: | ||
{{- toYaml .Values.loki.podSecurityContext | nindent 8 }} | ||
terminationGracePeriodSeconds: {{ .Values.bloomGateway.terminationGracePeriodSeconds }} | ||
{{- with .Values.bloomGateway.initContainers }} | ||
initContainers: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: bloom-gateway | ||
image: {{ include "loki.image" . }} | ||
imagePullPolicy: {{ .Values.loki.image.pullPolicy }} | ||
{{- if or .Values.loki.command .Values.bloomGateway.command }} | ||
command: | ||
- {{ coalesce .Values.bloomGateway.command .Values.loki.command | quote }} | ||
{{- end }} | ||
args: | ||
- -config.file=/etc/loki/config/config.yaml | ||
- -target=bloom-gateway | ||
{{- with .Values.bloomGateway.extraArgs }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
ports: | ||
- name: http-metrics | ||
containerPort: 3100 | ||
protocol: TCP | ||
- name: grpc | ||
containerPort: 9095 | ||
protocol: TCP | ||
- name: http-memberlist | ||
containerPort: 7946 | ||
protocol: TCP | ||
{{- with .Values.bloomGateway.extraEnv }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.extraEnvFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} | ||
{{- include "loki.bloomGateway.readinessProbe" . | nindent 10 }} | ||
volumeMounts: | ||
- name: temp | ||
mountPath: /tmp | ||
- name: config | ||
mountPath: /etc/loki/config | ||
- name: runtime-config | ||
mountPath: /etc/loki/runtime-config | ||
- name: data | ||
mountPath: /var/loki | ||
{{- if .Values.enterprise.enabled }} | ||
- name: license | ||
mountPath: /etc/loki/license | ||
{{- end }} | ||
{{- with .Values.bloomGateway.extraVolumeMounts }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.resources }} | ||
resources: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- if .Values.bloomGateway.extraContainers }} | ||
{{- toYaml .Values.bloomGateway.extraContainers | nindent 8}} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: temp | ||
emptyDir: {} | ||
- name: config | ||
{{- include "loki.configVolume" . | nindent 10 }} | ||
- name: runtime-config | ||
configMap: | ||
name: {{ template "loki.name" . }}-runtime | ||
{{- if .Values.enterprise.enabled }} | ||
- name: license | ||
secret: | ||
{{- if .Values.enterprise.useExternalLicense }} | ||
secretName: {{ .Values.enterprise.externalLicenseName }} | ||
{{- else }} | ||
secretName: enterprise-logs-license | ||
{{- end }} | ||
{{- end }} | ||
{{- if not .Values.bloomGateway.persistence.enabled }} | ||
- name: data | ||
emptyDir: {} | ||
{{- end }} | ||
{{- with .Values.bloomGateway.extraVolumes }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.bloomGateway.persistence.enabled }} | ||
volumeClaimTemplates: | ||
{{- range .Values.bloomGateway.persistence.claims }} | ||
- metadata: | ||
name: {{ .name }} | ||
{{- with .annotations }} | ||
annotations: | ||
{{- . | toYaml | nindent 10 }} | ||
{{- end }} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
{{- with .storageClass }} | ||
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }} | ||
{{- end }} | ||
resources: | ||
requests: | ||
storage: {{ .size | quote }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters