-
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.
Replace bloom compactor in Helm chart with bloom planner and builder
This is PR is part of the process of removing the bloom compactor and replace it with bloom planner and bloom builder. See also #13957 Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
- Loading branch information
Showing
13 changed files
with
1,110 additions
and
301 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
production/helm/loki/templates/bloom-builder/_helpers-bloom-builder.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,32 @@ | ||
{{/* | ||
bloom-builder fullname | ||
*/}} | ||
{{- define "loki.bloomBuilderFullname" -}} | ||
{{ include "loki.fullname" . }}-bloom-builder | ||
{{- end }} | ||
|
||
{{/* | ||
bloom-builder common labels | ||
*/}} | ||
{{- define "loki.bloomBuilderLabels" -}} | ||
{{ include "loki.labels" . }} | ||
app.kubernetes.io/component: bloom-builder | ||
{{- end }} | ||
|
||
{{/* | ||
bloom-builder selector labels | ||
*/}} | ||
{{- define "loki.bloomBuilderSelectorLabels" -}} | ||
{{ include "loki.selectorLabels" . }} | ||
app.kubernetes.io/component: bloom-builder | ||
{{- end }} | ||
|
||
{{/* | ||
bloom-builder priority class name | ||
*/}} | ||
{{- define "loki.bloomBuilderPriorityClassName" -}} | ||
{{- $pcn := coalesce .Values.global.priorityClassName .Values.bloomBuilder.priorityClassName -}} | ||
{{- if $pcn }} | ||
priorityClassName: {{ $pcn }} | ||
{{- end }} | ||
{{- end }} |
142 changes: 142 additions & 0 deletions
142
production/helm/loki/templates/bloom-builder/deployment-bloom-builder.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,142 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if $isDistributed -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "loki.bloomBuilderFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomBuilderLabels" . | nindent 4 }} | ||
{{- with .Values.loki.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if not .Values.bloomBuilder.autoscaling.enabled }} | ||
replicas: {{ .Values.bloomBuilder.replicas }} | ||
{{- end }} | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 0 | ||
maxUnavailable: 1 | ||
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }} | ||
selector: | ||
matchLabels: | ||
{{- include "loki.bloomBuilderSelectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- include "loki.config.checksum" . | nindent 8 }} | ||
{{- with .Values.loki.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "loki.bloomBuilderSelectorLabels" . | nindent 8 }} | ||
app.kubernetes.io/part-of: memberlist | ||
{{- with .Values.loki.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
serviceAccountName: {{ include "loki.serviceAccountName" . }} | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.hostAliases }} | ||
hostAliases: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- include "loki.bloomBuilderPriorityClassName" . | nindent 6 }} | ||
securityContext: | ||
{{- toYaml .Values.loki.podSecurityContext | nindent 8 }} | ||
terminationGracePeriodSeconds: {{ .Values.bloomBuilder.terminationGracePeriodSeconds }} | ||
containers: | ||
- name: bloom-builder | ||
image: {{ include "loki.image" . }} | ||
imagePullPolicy: {{ .Values.loki.image.pullPolicy }} | ||
{{- if or .Values.loki.command .Values.bloomBuilder.command }} | ||
command: | ||
- {{ coalesce .Values.bloomBuilder.command .Values.loki.command | quote }} | ||
{{- end }} | ||
args: | ||
- -config.file=/etc/loki/config/config.yaml | ||
- -target=bloom-builder | ||
{{- with .Values.bloomBuilder.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.bloomBuilder.extraEnv }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.extraEnvFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }} | ||
readinessProbe: | ||
{{- toYaml .Values.loki.readinessProbe | nindent 12 }} | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/loki/config | ||
- name: runtime-config | ||
mountPath: /etc/loki/runtime-config | ||
{{- if .Values.enterprise.enabled }} | ||
- name: license | ||
mountPath: /etc/loki/license | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.extraVolumeMounts }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.bloomBuilder.resources | nindent 12 }} | ||
{{- if .Values.bloomBuilder.extraContainers }} | ||
{{- toYaml .Values.bloomBuilder.extraContainers | nindent 8}} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- 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 }} | ||
{{- with .Values.bloomBuilder.extraVolumes }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if and $isDistributed .Values.bloomBuilder.autoscaling.enabled }} | ||
{{- $apiVersion := include "loki.hpa.apiVersion" . -}} | ||
apiVersion: {{ $apiVersion }} | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ include "loki.bloomBuilderFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomBuilderLabels" . | nindent 4 }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ include "loki.bloomBuilderFullname" . }} | ||
minReplicas: {{ .Values.bloomBuilder.autoscaling.minReplicas }} | ||
maxReplicas: {{ .Values.bloomBuilder.autoscaling.maxReplicas }} | ||
metrics: | ||
{{- with .Values.bloomBuilder.autoscaling.targetMemoryUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: memory | ||
{{- if (eq $apiVersion "autoscaling/v2") }} | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ . }} | ||
{{- else }} | ||
targetAverageUtilization: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.autoscaling.targetCPUUtilizationPercentage }} | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
{{- if (eq $apiVersion "autoscaling/v2") }} | ||
target: | ||
type: Utilization | ||
averageUtilization: {{ . }} | ||
{{- else }} | ||
targetAverageUtilization: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.autoscaling.customMetrics }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- if .Values.bloomBuilder.autoscaling.behavior.enabled }} | ||
behavior: | ||
{{- with .Values.bloomBuilder.autoscaling.behavior.scaleDown }} | ||
scaleDown: {{ toYaml . | nindent 6 }} | ||
{{- end }} | ||
{{- with .Values.bloomBuilder.autoscaling.behavior.scaleUp }} | ||
scaleUp: {{ toYaml . | nindent 6 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
21 changes: 21 additions & 0 deletions
21
production/helm/loki/templates/bloom-builder/poddisruptionbudget-bloom-builder.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,21 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if and $isDistributed (gt (int .Values.bloomBuilder.replicas) 1) }} | ||
{{- if kindIs "invalid" .Values.bloomBuilder.maxUnavailable }} | ||
{{- fail "`.Values.bloomBuilder.maxUnavailable` must be set when `.Values.bloomBuilder.replicas` is greater than 1." }} | ||
{{- else }} | ||
apiVersion: {{ include "loki.pdb.apiVersion" . }} | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{ include "loki.bloomBuilderFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomBuilderLabels" . | nindent 4 }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
{{- include "loki.bloomBuilderSelectorLabels" . | nindent 6 }} | ||
{{- with .Values.bloomBuilder.maxUnavailable }} | ||
maxUnavailable: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
43 changes: 43 additions & 0 deletions
43
production/helm/loki/templates/bloom-builder/service-bloom-builder-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,43 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if $isDistributed -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "loki.bloomBuilderFullname" . }}-headless | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomBuilderLabels" . | nindent 4 }} | ||
{{- with .Values.bloomBuilder.serviceLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
prometheus.io/service-monitor: "false" | ||
{{- with .Values.loki.serviceAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
clusterIP: None | ||
type: ClusterIP | ||
publishNotReadyAddresses: true | ||
ports: | ||
- name: http-metrics | ||
port: 3100 | ||
targetPort: http-metrics | ||
protocol: TCP | ||
- name: grpc | ||
port: 9095 | ||
targetPort: grpc | ||
protocol: TCP | ||
{{- if .Values.bloomBuilder.appProtocol.grpc }} | ||
appProtocol: {{ .Values.bloomBuilder.appProtocol.grpc }} | ||
{{- end }} | ||
- name: grpclb | ||
port: 9096 | ||
targetPort: grpc | ||
protocol: TCP | ||
{{- if .Values.bloomBuilder.appProtocol.grpc }} | ||
appProtocol: {{ .Values.bloomBuilder.appProtocol.grpc }} | ||
{{- end }} | ||
selector: | ||
{{- include "loki.bloomBuilderSelectorLabels" . | nindent 4 }} | ||
{{- end -}} |
41 changes: 41 additions & 0 deletions
41
production/helm/loki/templates/bloom-builder/service-bloom-builder.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,41 @@ | ||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}} | ||
{{- if $isDistributed -}} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "loki.bloomBuilderFullname" . }} | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "loki.bloomBuilderLabels" . | nindent 4 }} | ||
{{- with .Values.bloomBuilder.serviceLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.loki.serviceAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
type: ClusterIP | ||
publishNotReadyAddresses: true | ||
ports: | ||
- name: http-metrics | ||
port: 3100 | ||
targetPort: http-metrics | ||
protocol: TCP | ||
- name: grpc | ||
port: 9095 | ||
targetPort: grpc | ||
protocol: TCP | ||
{{- if .Values.bloomBuilder.appProtocol.grpc }} | ||
appProtocol: {{ .Values.bloomBuilder.appProtocol.grpc }} | ||
{{- end }} | ||
- name: grpclb | ||
port: 9096 | ||
targetPort: grpc | ||
protocol: TCP | ||
{{- if .Values.bloomBuilder.appProtocol.grpc }} | ||
appProtocol: {{ .Values.bloomBuilder.appProtocol.grpc }} | ||
{{- end }} | ||
selector: | ||
{{- include "loki.bloomBuilderSelectorLabels" . | nindent 4 }} | ||
{{- end -}} |
Oops, something went wrong.