Skip to content

Commit

Permalink
Renaming ruler* to parallel*
Browse files Browse the repository at this point in the history
  • Loading branch information
Imshelledin21 committed Nov 25, 2024
1 parent 99ec81f commit 34c71d4
Show file tree
Hide file tree
Showing 22 changed files with 305 additions and 305 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
parallel querier fullname
*/}}
{{- define "loki.parallelQuerierFullname" -}}
{{ include "loki.fullname" . }}-parallel-querier
{{- end }}

{{/*
parallel querier common labels
*/}}
{{- define "loki.parallelQuerierLabels" -}}
{{ include "loki.labels" . }}
app.kubernetes.io/component:parallel-querier
{{- end }}

{{/*
parallel querier selector labels
*/}}
{{- define "loki.parallelQuerierSelectorLabels" -}}
{{ include "loki.selectorLabels" . }}
app.kubernetes.io/component: parallel-querier
{{- end }}

{{/*
parallel querier priority class name
*/}}
{{- define "loki.parallelQuerierPriorityClassName" -}}
{{- $pcn := coalesce .Values.global.priorityClassName .Values.parallelQuerier.priorityClassName -}}
{{- if $pcn }}
priorityClassName: {{ $pcn }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "loki.rulerQuerierFullname" . }}
name: {{ include "loki.parallelQuerierFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.rulerQuerierLabels" . | nindent 4 }}
{{- include "loki.parallelQuerierLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.rulerQuerier.autoscaling.enabled }}
replicas: {{ .Values.rulerQuerier.replicas }}
{{- if not .Values.parallelQuerier.autoscaling.enabled }}
replicas: {{ .Values.parallelQuerier.replicas }}
{{- end }}
strategy:
rollingUpdate:
maxSurge: {{ .Values.rulerQuerier.maxSurge }}
maxSurge: {{ .Values.parallelQuerier.maxSurge }}
maxUnavailable: 1
revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "loki.rulerQuerierSelectorLabels" . | nindent 6 }}
{{- include "loki.parallelQuerierSelectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
{{- include "loki.config.checksum" . | nindent 8 }}
{{- with .Values.loki.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.rulerQuerier.podAnnotations }}
{{- with .Values.parallelQuerier.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.rulerQuerierSelectorLabels" . | nindent 8 }}
{{- include "loki.parallelQuerierSelectorLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.rulerQuerier.podLabels }}
{{- with .Values.parallelQuerier.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- with .Values.rulerQuerier.topologySpreadConstraints }}
{{- with .Values.parallelQuerier.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -56,20 +56,20 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.rulerQuerier.hostAliases }}
{{- with .Values.parallelQuerier.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "loki.rulerQuerierPriorityClassName" . | nindent 6 }}
{{- include "loki.parallelQuerierPriorityClassName" . | nindent 6 }}
securityContext:
{{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.rulerQuerier.terminationGracePeriodSeconds }}
{{- with .Values.rulerQuerier.initContainers }}
terminationGracePeriodSeconds: {{ .Values.parallelQuerier.terminationGracePeriodSeconds }}
{{- with .Values.parallelQuerier.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: ruler-querier
- name: parallel-querier
image: {{ include "loki.image" . }}
imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
args:
Expand All @@ -82,7 +82,7 @@ spec:
- -distributor.zone-awareness-enabled=true
{{- end }}
{{- end }}
{{- with .Values.rulerQuerier.extraArgs }}
{{- with .Values.parallelQuerier.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
Expand All @@ -95,11 +95,11 @@ spec:
- name: http-memberlist
containerPort: 7946
protocol: TCP
{{- with .Values.rulerQuerier.extraEnv }}
{{- with .Values.parallelQuerier.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.rulerQuerier.extraEnvFrom }}
{{- with .Values.parallelQuerier.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -120,27 +120,27 @@ spec:
- name: license
mountPath: /etc/loki/license
{{- end }}
{{- with .Values.rulerQuerier.extraVolumeMounts }}
{{- with .Values.parallelQuerier.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.rulerQuerier.resources | nindent 12 }}
{{- if .Values.rulerQuerier.extraContainers }}
{{- toYaml .Values.rulerQuerier.extraContainers | nindent 8}}
{{- toYaml .Values.parallelQuerier.resources | nindent 12 }}
{{- if .Values.parallelQuerier.extraContainers }}
{{- toYaml .Values.parallelQuerier.extraContainers | nindent 8}}
{{- end }}
{{- with .Values.rulerQuerier.affinity }}
{{- with .Values.parallelQuerier.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.rulerQuerier.nodeSelector }}
{{- with .Values.parallelQuerier.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.rulerQuerier.tolerations }}
{{- with .Values.parallelQuerier.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.rulerQuerier.dnsConfig }}
{{- with .Values.parallelQuerier.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -161,7 +161,7 @@ spec:
{{- end }}
- name: data
emptyDir: {}
{{- with .Values.rulerQuerier.extraVolumes }}
{{- with .Values.parallelQuerier.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{{- if .Values.ruler.remoteEvaluationDedicatedQueryPath }}
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if and $isDistributed .Values.rulerQuerier.autoscaling.enabled }}
{{- if and $isDistributed .Values.parallelQuerier.autoscaling.enabled }}
{{- $apiVersion := include "loki.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "loki.rulerQuerierFullname" . }}
name: {{ include "loki.parallelQuerierFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.rulerQuerierLabels" . | nindent 4 }}
{{- include "loki.parallelQuerierLabels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "loki.rulerQuerierFullname" . }}
minReplicas: {{ .Values.rulerQuerier.autoscaling.minReplicas }}
maxReplicas: {{ .Values.rulerQuerier.autoscaling.maxReplicas }}
name: {{ include "loki.parallelQuerierFullname" . }}
minReplicas: {{ .Values.parallelQuerier.autoscaling.minReplicas }}
maxReplicas: {{ .Values.parallelQuerier.autoscaling.maxReplicas }}
metrics:
{{- with .Values.rulerQuerier.autoscaling.targetMemoryUtilizationPercentage }}
{{- with .Values.parallelQuerier.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
Expand All @@ -29,7 +29,7 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.rulerQuerier.autoscaling.targetCPUUtilizationPercentage }}
{{- with .Values.parallelQuerier.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
Expand All @@ -41,15 +41,15 @@ spec:
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.rulerQuerier.autoscaling.customMetrics }}
{{- with .Values.parallelQuerier.autoscaling.customMetrics }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.rulerQuerier.autoscaling.behavior.enabled }}
{{- if .Values.parallelQuerier.autoscaling.behavior.enabled }}
behavior:
{{- with .Values.rulerQuerier.autoscaling.behavior.scaleDown }}
{{- with .Values.parallelQuerier.autoscaling.behavior.scaleDown }}
scaleDown: {{ toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.rulerQuerier.autoscaling.behavior.scaleUp }}
{{- with .Values.parallelQuerier.autoscaling.behavior.scaleUp }}
scaleUp: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.ruler.remoteEvaluationDedicatedQueryPath }}
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
{{- if and $isDistributed (gt (int .Values.parallelQuerier.replicas) 1) }}
{{- if kindIs "invalid" .Values.parallelQuerier.maxUnavailable }}
{{- fail "`.Values.parallelQuerier.maxUnavailable` must be set when `.Values.parallelQuerier.replicas` is greater than 1." }}
{{- else }}
apiVersion: {{ include "loki.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "loki.parallelQuerierFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.parallelQuerierLabels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "loki.parallelQuerierSelectorLabels" . | nindent 6 }}
{{- with .Values.parallelQuerier.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "loki.rulerQuerierFullname" . }}
name: {{ include "loki.parallelQuerierFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "loki.rulerQuerierLabels" . | nindent 4 }}
{{- with .Values.rulerQuerier.serviceLabels }}
{{- include "loki.parallelQuerierLabels" . | nindent 4 }}
{{- with .Values.parallelQuerier.serviceLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- with .Values.loki.serviceAnnotations }}
{{- toYaml . | nindent 4}}
{{- end }}
{{- with .Values.rulerQuerier.serviceAnnotations }}
{{- with .Values.parallelQuerier.serviceAnnotations }}
{{- toYaml . | nindent 4}}
{{- end }}
spec:
Expand All @@ -29,10 +29,10 @@ spec:
port: 9095
targetPort: grpc
protocol: TCP
{{- if .Values.rulerQuerier.appProtocol.grpc }}
appProtocol: {{ .Values.rulerQuerier.appProtocol.grpc }}
{{- if .Values.parallelQuerier.appProtocol.grpc }}
appProtocol: {{ .Values.parallelQuerier.appProtocol.grpc }}
{{- end }}
selector:
{{- include "loki.rulerQuerierSelectorLabels" . | nindent 4 }}
{{- include "loki.parallelQuerierSelectorLabels" . | nindent 4 }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/*
parallel-query-frontend fullname
*/}}
{{- define "loki.parallelQueryFrontendFullname" -}}
{{ include "loki.fullname" . }}-parallel-query-frontend
{{- end }}

{{/*
parallel-query-frontend common labels
*/}}
{{- define "loki.parallelQueryFrontendLabels" -}}
{{ include "loki.labels" . }}
app.kubernetes.io/component: parallel-query-frontend
{{- end }}

{{/*
parallel-query-frontend selector labels
*/}}
{{- define "loki.parallelQueryFrontendSelectorLabels" -}}
{{ include "loki.selectorLabels" . }}
app.kubernetes.io/component: parallel-query-frontend
{{- end }}

{{/*
parallel-query-frontend priority class name
*/}}
{{- define "loki.parallelQueryFrontendPriorityClassName" -}}
{{- $pcn := coalesce .Values.global.priorityClassName .Values.parallelQueryFrontend.priorityClassName -}}
{{- if $pcn }}
priorityClassName: {{ $pcn }}
{{- end }}
{{- end }}
Loading

0 comments on commit 34c71d4

Please sign in to comment.