Adding dependencies, binary autostart
This commit is contained in:
		@@ -0,0 +1,74 @@
 | 
			
		||||
{{/*
 | 
			
		||||
ingester fullname
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "loki.ingesterFullname" -}}
 | 
			
		||||
{{ include "loki.fullname" . }}-ingester
 | 
			
		||||
{{- end }}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
ingester common labels
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "loki.ingesterLabels" -}}
 | 
			
		||||
{{ include "loki.labels" . }}
 | 
			
		||||
app.kubernetes.io/component: ingester
 | 
			
		||||
{{- end }}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
ingester selector labels
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "loki.ingesterSelectorLabels" -}}
 | 
			
		||||
{{ include "loki.selectorLabels" . }}
 | 
			
		||||
app.kubernetes.io/component: ingester
 | 
			
		||||
{{- end }}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
ingester priority class name
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "loki.ingesterPriorityClassName" -}}
 | 
			
		||||
{{- $pcn := coalesce .Values.global.priorityClassName .Values.ingester.priorityClassName -}}
 | 
			
		||||
{{- if $pcn }}
 | 
			
		||||
priorityClassName: {{ $pcn }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
 | 
			
		||||
{{- define "loki.ingester.readinessProbe" -}}
 | 
			
		||||
{{- with .Values.ingester.readinessProbe }}  
 | 
			
		||||
readinessProbe:
 | 
			
		||||
  {{- toYaml . | nindent 2 }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
{{- with .Values.loki.readinessProbe }}
 | 
			
		||||
readinessProbe:
 | 
			
		||||
  {{- toYaml . | nindent 2 }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{- define "loki.ingester.livenessProbe" -}}
 | 
			
		||||
{{- with .Values.ingester.livenessProbe }}
 | 
			
		||||
livenessProbe:
 | 
			
		||||
  {{- toYaml . | nindent 2 }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
{{- with .Values.loki.livenessProbe }}
 | 
			
		||||
livenessProbe:
 | 
			
		||||
  {{- toYaml . | nindent 2 }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
expects global context
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "loki.ingester.replicaCount" -}}
 | 
			
		||||
{{- ceil (divf .Values.ingester.replicas 3) -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
expects a dict
 | 
			
		||||
{
 | 
			
		||||
  "replicas": replicas in a zone,
 | 
			
		||||
  "ctx": global context
 | 
			
		||||
}
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "loki.ingester.maxUnavailable" -}}
 | 
			
		||||
{{- ceil (mulf .replicas (divf (int .ctx.Values.ingester.zoneAwareReplication.maxUnavailablePct) 100)) -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
							
								
								
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa-zone-a.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa-zone-a.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.autoscaling.enabled .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
{{- $apiVersion := include "loki.hpa.apiVersion" . -}}
 | 
			
		||||
apiVersion: {{ $apiVersion }}
 | 
			
		||||
kind: HorizontalPodAutoscaler
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-a
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
spec:
 | 
			
		||||
  scaleTargetRef:
 | 
			
		||||
    apiVersion: apps/v1
 | 
			
		||||
    kind: StatefulSet
 | 
			
		||||
    name: {{ include "loki.ingesterFullname" . }}-zone-a
 | 
			
		||||
  minReplicas: {{ .Values.ingester.autoscaling.minReplicas }}
 | 
			
		||||
  maxReplicas: {{ .Values.ingester.autoscaling.maxReplicas }}
 | 
			
		||||
  metrics:
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: memory
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetCPUUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: cpu
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.customMetrics }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- if .Values.ingester.autoscaling.behavior.enabled }}
 | 
			
		||||
  behavior:
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleDown }}
 | 
			
		||||
    scaleDown: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleUp }}
 | 
			
		||||
    scaleUp: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
							
								
								
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa-zone-b.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa-zone-b.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.autoscaling.enabled .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
{{- $apiVersion := include "loki.hpa.apiVersion" . -}}
 | 
			
		||||
apiVersion: {{ $apiVersion }}
 | 
			
		||||
kind: HorizontalPodAutoscaler
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-b
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
spec:
 | 
			
		||||
  scaleTargetRef:
 | 
			
		||||
    apiVersion: apps/v1
 | 
			
		||||
    kind: StatefulSet
 | 
			
		||||
    name: {{ include "loki.ingesterFullname" . }}-zone-b
 | 
			
		||||
  minReplicas: {{ .Values.ingester.autoscaling.minReplicas }}
 | 
			
		||||
  maxReplicas: {{ .Values.ingester.autoscaling.maxReplicas }}
 | 
			
		||||
  metrics:
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: memory
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetCPUUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: cpu
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.customMetrics }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- if .Values.ingester.autoscaling.behavior.enabled }}
 | 
			
		||||
  behavior:
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleDown }}
 | 
			
		||||
    scaleDown: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleUp }}
 | 
			
		||||
    scaleUp: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
							
								
								
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa-zone-c.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa-zone-c.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.autoscaling.enabled .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
{{- $apiVersion := include "loki.hpa.apiVersion" . -}}
 | 
			
		||||
apiVersion: {{ $apiVersion }}
 | 
			
		||||
kind: HorizontalPodAutoscaler
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-c
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
spec:
 | 
			
		||||
  scaleTargetRef:
 | 
			
		||||
    apiVersion: apps/v1
 | 
			
		||||
    kind: StatefulSet
 | 
			
		||||
    name: {{ include "loki.ingesterFullname" . }}-zone-c
 | 
			
		||||
  minReplicas: {{ .Values.ingester.autoscaling.minReplicas }}
 | 
			
		||||
  maxReplicas: {{ .Values.ingester.autoscaling.maxReplicas }}
 | 
			
		||||
  metrics:
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: memory
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetCPUUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: cpu
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.customMetrics }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- if .Values.ingester.autoscaling.behavior.enabled }}
 | 
			
		||||
  behavior:
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleDown }}
 | 
			
		||||
    scaleDown: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleUp }}
 | 
			
		||||
    scaleUp: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
							
								
								
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								opencloud/charts/loki/templates/ingester/hpa.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.autoscaling.enabled (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }}
 | 
			
		||||
{{- $apiVersion := include "loki.hpa.apiVersion" . -}}
 | 
			
		||||
apiVersion: {{ $apiVersion }}
 | 
			
		||||
kind: HorizontalPodAutoscaler
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
spec:
 | 
			
		||||
  scaleTargetRef:
 | 
			
		||||
    apiVersion: apps/v1
 | 
			
		||||
    kind: StatefulSet
 | 
			
		||||
    name: {{ include "loki.ingesterFullname" . }}
 | 
			
		||||
  minReplicas: {{ .Values.ingester.autoscaling.minReplicas }}
 | 
			
		||||
  maxReplicas: {{ .Values.ingester.autoscaling.maxReplicas }}
 | 
			
		||||
  metrics:
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: memory
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.targetCPUUtilizationPercentage }}
 | 
			
		||||
    - type: Resource
 | 
			
		||||
      resource:
 | 
			
		||||
        name: cpu
 | 
			
		||||
        {{- if (eq $apiVersion "autoscaling/v2") }}
 | 
			
		||||
        target:
 | 
			
		||||
          type: Utilization
 | 
			
		||||
          averageUtilization: {{ . }}
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        targetAverageUtilization: {{ . }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- with .Values.ingester.autoscaling.customMetrics }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  {{- if .Values.ingester.autoscaling.behavior.enabled }}
 | 
			
		||||
  behavior:
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleDown }}
 | 
			
		||||
    scaleDown: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.autoscaling.behavior.scaleUp }}
 | 
			
		||||
    scaleUp: {{ toYaml . | nindent 6 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
@@ -0,0 +1,21 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed (gt (int .Values.ingester.replicas) 1) (.Values.ingester.zoneAwareReplication.enabled) }}
 | 
			
		||||
{{- if kindIs "invalid" .Values.ingester.maxUnavailable }}
 | 
			
		||||
{{- fail "`.Values.ingester.maxUnavailable` must be set when `.Values.ingester.replicas` is greater than 1." }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
apiVersion: {{ include "loki.pdb.apiVersion" . }}
 | 
			
		||||
kind: PodDisruptionBudget
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-rollout
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
spec:
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      rollout-group: ingester
 | 
			
		||||
  {{- with .Values.ingester.maxUnavailable }}
 | 
			
		||||
  maxUnavailable: {{ . }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
@@ -0,0 +1,27 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed (gt (int .Values.ingester.replicas) 1) (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }}
 | 
			
		||||
{{- if kindIs "invalid" .Values.ingester.maxUnavailable }}
 | 
			
		||||
{{- fail "`.Values.ingester.maxUnavailable` must be set when `.Values.ingester.replicas` is greater than 1." }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
apiVersion: {{ include "loki.pdb.apiVersion" . }}
 | 
			
		||||
kind: PodDisruptionBudget
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
spec:
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      {{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
 | 
			
		||||
    {{/* zone aware ingesters get their own pod disruption budget, ignore them here */}}
 | 
			
		||||
    matchExpressions:
 | 
			
		||||
      - key: rollout-group
 | 
			
		||||
        operator: NotIn
 | 
			
		||||
        values:
 | 
			
		||||
          - "ingester"
 | 
			
		||||
  {{- with .Values.ingester.maxUnavailable }}
 | 
			
		||||
  maxUnavailable: {{ . }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
@@ -0,0 +1,35 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }}
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-headless
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
 | 
			
		||||
    prometheus.io/service-monitor: "false"
 | 
			
		||||
  annotations:
 | 
			
		||||
    {{- with .Values.loki.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
  type: ClusterIP
 | 
			
		||||
  clusterIP: None
 | 
			
		||||
  ports:
 | 
			
		||||
    - name: http-metrics
 | 
			
		||||
      port: 3100
 | 
			
		||||
      targetPort: http-metrics
 | 
			
		||||
      protocol: TCP
 | 
			
		||||
    - name: grpc
 | 
			
		||||
      port: 9095
 | 
			
		||||
      targetPort: grpc
 | 
			
		||||
      protocol: TCP
 | 
			
		||||
      {{- if .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      appProtocol: {{ .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    {{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-a-headless
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    {{- with .Values.ingester.serviceLabels }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    {{- with .Values.loki.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.serviceAnnotations }}
 | 
			
		||||
    {{- 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.ingester.appProtocol.grpc }}
 | 
			
		||||
      appProtocol: {{ .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    {{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
 | 
			
		||||
    name: ingester-zone-a
 | 
			
		||||
    rollout-group: ingester
 | 
			
		||||
{{- end -}}
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-b-headless
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    {{- with .Values.ingester.serviceLabels }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    {{- with .Values.loki.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.serviceAnnotations }}
 | 
			
		||||
    {{- 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.ingester.appProtocol.grpc }}
 | 
			
		||||
      appProtocol: {{ .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    {{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
 | 
			
		||||
    name: ingester-zone-b
 | 
			
		||||
    rollout-group: ingester
 | 
			
		||||
{{- end -}}
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-c-headless
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    {{- with .Values.ingester.serviceLabels }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    {{- with .Values.loki.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.serviceAnnotations }}
 | 
			
		||||
    {{- 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.ingester.appProtocol.grpc }}
 | 
			
		||||
      appProtocol: {{ .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    {{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
 | 
			
		||||
    name: ingester-zone-c
 | 
			
		||||
    rollout-group: ingester
 | 
			
		||||
{{- end -}}
 | 
			
		||||
@@ -0,0 +1,36 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }}
 | 
			
		||||
apiVersion: v1
 | 
			
		||||
kind: Service
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    {{- with .Values.ingester.serviceLabels }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    {{- with .Values.loki.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.serviceAnnotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4}}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
  type: ClusterIP
 | 
			
		||||
  ports:
 | 
			
		||||
    - name: http-metrics
 | 
			
		||||
      port: 3100
 | 
			
		||||
      targetPort: http-metrics
 | 
			
		||||
      protocol: TCP
 | 
			
		||||
    - name: grpc
 | 
			
		||||
      port: 9095
 | 
			
		||||
      targetPort: grpc
 | 
			
		||||
      protocol: TCP
 | 
			
		||||
      {{- if .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      appProtocol: {{ .Values.ingester.appProtocol.grpc }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    {{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
@@ -0,0 +1,234 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
{{- $replicas := (include "loki.ingester.replicaCount" .) -}}
 | 
			
		||||
apiVersion: apps/v1
 | 
			
		||||
kind: StatefulSet
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-a
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    app.kubernetes.io/part-of: memberlist
 | 
			
		||||
    rollout-group: ingester
 | 
			
		||||
    name: ingester-zone-a
 | 
			
		||||
  annotations:
 | 
			
		||||
    rollout-max-unavailable: "{{ include "loki.ingester.maxUnavailable" (dict "ctx" . "replicas" $replicas)}}"
 | 
			
		||||
    {{- with .Values.loki.annotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.zoneAwareReplication.zoneA.annotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
{{- if not .Values.ingester.autoscaling.enabled }}
 | 
			
		||||
  replicas: {{ $replicas }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  podManagementPolicy: Parallel
 | 
			
		||||
  serviceName: {{ include "loki.ingesterFullname" . }}-zone-a
 | 
			
		||||
  revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
 | 
			
		||||
  {{- if and (semverCompare ">= 1.23-0" (include "loki.kubeVersion" .)) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC)  }}
 | 
			
		||||
  {{/*
 | 
			
		||||
    Data on the read nodes is easy to replace, so we want to always delete PVCs to make
 | 
			
		||||
    operation easier, and will rely on re-fetching data when needed.
 | 
			
		||||
  */}}
 | 
			
		||||
  persistentVolumeClaimRetentionPolicy:
 | 
			
		||||
    whenDeleted: {{ .Values.ingester.persistence.whenDeleted }}
 | 
			
		||||
    whenScaled: {{ .Values.ingester.persistence.whenScaled }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      {{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
 | 
			
		||||
      name: ingester-zone-a
 | 
			
		||||
      rollout-group: ingester
 | 
			
		||||
{{- with .Values.ingester.updateStrategy }}
 | 
			
		||||
  updateStrategy:
 | 
			
		||||
     {{- tpl (. | toYaml) $ | nindent 4 }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  template:
 | 
			
		||||
    metadata:
 | 
			
		||||
      annotations:
 | 
			
		||||
        {{- include "loki.config.checksum" . | nindent 8 }}
 | 
			
		||||
        {{- with .Values.loki.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.zoneAwareReplication.zoneA.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      labels:
 | 
			
		||||
        {{- include "loki.ingesterSelectorLabels" . | nindent 8 }}
 | 
			
		||||
        app.kubernetes.io/part-of: memberlist
 | 
			
		||||
        name: ingester-zone-a
 | 
			
		||||
        rollout-group: ingester
 | 
			
		||||
        {{- with .Values.loki.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
    spec:
 | 
			
		||||
      {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
 | 
			
		||||
      {{- with .Values.ingester.topologySpreadConstraints }}
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      serviceAccountName: {{ include "loki.serviceAccountName" . }}
 | 
			
		||||
      {{- with .Values.imagePullSecrets }}
 | 
			
		||||
      imagePullSecrets:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.hostAliases }}
 | 
			
		||||
      hostAliases:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- include "loki.ingesterPriorityClassName" . | nindent 6 }}
 | 
			
		||||
      securityContext:
 | 
			
		||||
        {{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
 | 
			
		||||
      terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
 | 
			
		||||
      {{- with .Values.ingester.initContainers }}
 | 
			
		||||
      initContainers:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      containers:
 | 
			
		||||
        - name: ingester
 | 
			
		||||
          image: {{ include "loki.image" . }}
 | 
			
		||||
          imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
 | 
			
		||||
          {{- if or .Values.loki.command .Values.ingester.command }}
 | 
			
		||||
          command:
 | 
			
		||||
            - {{ coalesce .Values.ingester.command .Values.loki.command | quote }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          args:
 | 
			
		||||
            - -config.file=/etc/loki/config/config.yaml
 | 
			
		||||
            - -ingester.availability-zone=zone-a
 | 
			
		||||
            - -ingester.unregister-on-shutdown=false
 | 
			
		||||
            - -ingester.tokens-file-path=/var/loki/ring-tokens
 | 
			
		||||
            - -target=ingester
 | 
			
		||||
            {{- with .Values.ingester.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.ingester.extraEnv }}
 | 
			
		||||
          env:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.extraEnvFrom }}
 | 
			
		||||
          envFrom:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          securityContext:
 | 
			
		||||
            {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
 | 
			
		||||
          {{- include "loki.ingester.readinessProbe" . | nindent 10 }}
 | 
			
		||||
          {{- include "loki.ingester.livenessProbe" . | nindent 10 }}
 | 
			
		||||
          volumeMounts:
 | 
			
		||||
            - 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.ingester.extraVolumeMounts }}
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
            {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.resources }}
 | 
			
		||||
          resources:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.lifecycle }}
 | 
			
		||||
          lifecycle:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.extraContainers }}
 | 
			
		||||
        {{- toYaml .Values.ingester.extraContainers | nindent 8}}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      affinity:
 | 
			
		||||
        podAntiAffinity:
 | 
			
		||||
          requiredDuringSchedulingIgnoredDuringExecution:
 | 
			
		||||
            - labelSelector:
 | 
			
		||||
                matchExpressions:
 | 
			
		||||
                  - key: rollout-group
 | 
			
		||||
                    operator: In
 | 
			
		||||
                    values:
 | 
			
		||||
                      - ingester
 | 
			
		||||
                  - key: name
 | 
			
		||||
                    operator: NotIn
 | 
			
		||||
                    values:
 | 
			
		||||
                      - ingester-zone-a
 | 
			
		||||
              topologyKey: kubernetes.io/hostname
 | 
			
		||||
        {{- with .Values.ingester.zoneAwareReplication.zoneA.extraAffinity }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.zoneAwareReplication.zoneA.nodeSelector }}
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.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.ingester.extraVolumes }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- if not .Values.ingester.persistence.enabled }}
 | 
			
		||||
        - name: data
 | 
			
		||||
          emptyDir: {}
 | 
			
		||||
  {{- else if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
        - name: data
 | 
			
		||||
        {{- if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
          emptyDir:
 | 
			
		||||
            medium: Memory
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.persistence.size }}
 | 
			
		||||
            sizeLimit: {{ .Values.ingester.persistence.size }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- else }}
 | 
			
		||||
  volumeClaimTemplates:
 | 
			
		||||
  {{- range .Values.ingester.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 }}
 | 
			
		||||
@@ -0,0 +1,234 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
{{- $replicas := (include "loki.ingester.replicaCount" .) -}}
 | 
			
		||||
apiVersion: apps/v1
 | 
			
		||||
kind: StatefulSet
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-b
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    app.kubernetes.io/part-of: memberlist
 | 
			
		||||
    rollout-group: ingester
 | 
			
		||||
    name: ingester-zone-b
 | 
			
		||||
  annotations:
 | 
			
		||||
    rollout-max-unavailable: "{{ include "loki.ingester.maxUnavailable" (dict "ctx" . "replicas" $replicas)}}"
 | 
			
		||||
    {{- with .Values.loki.annotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.zoneAwareReplication.zoneB.annotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
{{- if not .Values.ingester.autoscaling.enabled }}
 | 
			
		||||
  replicas: {{ $replicas }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  podManagementPolicy: Parallel
 | 
			
		||||
  serviceName: {{ include "loki.ingesterFullname" . }}-zone-b
 | 
			
		||||
  revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
 | 
			
		||||
  {{- if and (semverCompare ">= 1.23-0" (include "loki.kubeVersion" .)) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC)  }}
 | 
			
		||||
  {{/*
 | 
			
		||||
    Data on the read nodes is easy to replace, so we want to always delete PVCs to make
 | 
			
		||||
    operation easier, and will rely on re-fetching data when needed.
 | 
			
		||||
  */}}
 | 
			
		||||
  persistentVolumeClaimRetentionPolicy:
 | 
			
		||||
    whenDeleted: {{ .Values.ingester.persistence.whenDeleted }}
 | 
			
		||||
    whenScaled: {{ .Values.ingester.persistence.whenScaled }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      {{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
 | 
			
		||||
      name: ingester-zone-b
 | 
			
		||||
      rollout-group: ingester
 | 
			
		||||
{{- with .Values.ingester.updateStrategy }}
 | 
			
		||||
  updateStrategy:
 | 
			
		||||
     {{- tpl (. | toYaml) $ | nindent 4 }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  template:
 | 
			
		||||
    metadata:
 | 
			
		||||
      annotations:
 | 
			
		||||
        {{- include "loki.config.checksum" . | nindent 8 }}
 | 
			
		||||
        {{- with .Values.loki.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.zoneAwareReplication.zoneB.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      labels:
 | 
			
		||||
        {{- include "loki.ingesterSelectorLabels" . | nindent 8 }}
 | 
			
		||||
        app.kubernetes.io/part-of: memberlist
 | 
			
		||||
        name: ingester-zone-b
 | 
			
		||||
        rollout-group: ingester
 | 
			
		||||
        {{- with .Values.loki.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
    spec:
 | 
			
		||||
      {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
 | 
			
		||||
      {{- with .Values.ingester.topologySpreadConstraints }}
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      serviceAccountName: {{ include "loki.serviceAccountName" . }}
 | 
			
		||||
      {{- with .Values.imagePullSecrets }}
 | 
			
		||||
      imagePullSecrets:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.hostAliases }}
 | 
			
		||||
      hostAliases:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- include "loki.ingesterPriorityClassName" . | nindent 6 }}
 | 
			
		||||
      securityContext:
 | 
			
		||||
        {{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
 | 
			
		||||
      terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
 | 
			
		||||
      {{- with .Values.ingester.initContainers }}
 | 
			
		||||
      initContainers:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      containers:
 | 
			
		||||
        - name: ingester
 | 
			
		||||
          image: {{ include "loki.image" . }}
 | 
			
		||||
          imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
 | 
			
		||||
          {{- if or .Values.loki.command .Values.ingester.command }}
 | 
			
		||||
          command:
 | 
			
		||||
            - {{ coalesce .Values.ingester.command .Values.loki.command | quote }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          args:
 | 
			
		||||
            - -config.file=/etc/loki/config/config.yaml
 | 
			
		||||
            - -ingester.availability-zone=zone-b
 | 
			
		||||
            - -ingester.unregister-on-shutdown=false
 | 
			
		||||
            - -ingester.tokens-file-path=/var/loki/ring-tokens
 | 
			
		||||
            - -target=ingester
 | 
			
		||||
            {{- with .Values.ingester.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.ingester.extraEnv }}
 | 
			
		||||
          env:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.extraEnvFrom }}
 | 
			
		||||
          envFrom:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          securityContext:
 | 
			
		||||
            {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
 | 
			
		||||
          {{- include "loki.ingester.readinessProbe" . | nindent 10 }}
 | 
			
		||||
          {{- include "loki.ingester.livenessProbe" . | nindent 10 }}
 | 
			
		||||
          volumeMounts:
 | 
			
		||||
            - 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.ingester.extraVolumeMounts }}
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
            {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.resources }}
 | 
			
		||||
          resources:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.lifecycle }}
 | 
			
		||||
          lifecycle:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.extraContainers }}
 | 
			
		||||
        {{- toYaml .Values.ingester.extraContainers | nindent 8}}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      affinity:
 | 
			
		||||
        podAntiAffinity:
 | 
			
		||||
          requiredDuringSchedulingIgnoredDuringExecution:
 | 
			
		||||
            - labelSelector:
 | 
			
		||||
                matchExpressions:
 | 
			
		||||
                  - key: rollout-group
 | 
			
		||||
                    operator: In
 | 
			
		||||
                    values:
 | 
			
		||||
                      - ingester
 | 
			
		||||
                  - key: name
 | 
			
		||||
                    operator: NotIn
 | 
			
		||||
                    values:
 | 
			
		||||
                      - ingester-zone-b
 | 
			
		||||
              topologyKey: kubernetes.io/hostname
 | 
			
		||||
        {{- with .Values.ingester.zoneAwareReplication.zoneB.extraAffinity }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.zoneAwareReplication.zoneB.nodeSelector }}
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.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.ingester.extraVolumes }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- if not .Values.ingester.persistence.enabled }}
 | 
			
		||||
        - name: data
 | 
			
		||||
          emptyDir: {}
 | 
			
		||||
  {{- else if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
        - name: data
 | 
			
		||||
        {{- if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
          emptyDir:
 | 
			
		||||
            medium: Memory
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.persistence.size }}
 | 
			
		||||
            sizeLimit: {{ .Values.ingester.persistence.size }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- else }}
 | 
			
		||||
  volumeClaimTemplates:
 | 
			
		||||
  {{- range .Values.ingester.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 }}
 | 
			
		||||
@@ -0,0 +1,234 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed .Values.ingester.zoneAwareReplication.enabled }}
 | 
			
		||||
{{- $replicas := (include "loki.ingester.replicaCount" .) -}}
 | 
			
		||||
apiVersion: apps/v1
 | 
			
		||||
kind: StatefulSet
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}-zone-c
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    app.kubernetes.io/part-of: memberlist
 | 
			
		||||
    rollout-group: ingester
 | 
			
		||||
    name: ingester-zone-c
 | 
			
		||||
  annotations:
 | 
			
		||||
    rollout-max-unavailable: "{{ include "loki.ingester.maxUnavailable" (dict "ctx" . "replicas" $replicas)}}"
 | 
			
		||||
    {{- with .Values.loki.annotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- with .Values.ingester.zoneAwareReplication.zoneC.annotations }}
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
    {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
{{- if not .Values.ingester.autoscaling.enabled }}
 | 
			
		||||
  replicas: {{ $replicas }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  podManagementPolicy: Parallel
 | 
			
		||||
  serviceName: {{ include "loki.ingesterFullname" . }}-zone-c
 | 
			
		||||
  revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
 | 
			
		||||
  {{- if and (semverCompare ">= 1.23-0" (include "loki.kubeVersion" .)) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC)  }}
 | 
			
		||||
  {{/*
 | 
			
		||||
    Data on the read nodes is easy to replace, so we want to always delete PVCs to make
 | 
			
		||||
    operation easier, and will rely on re-fetching data when needed.
 | 
			
		||||
  */}}
 | 
			
		||||
  persistentVolumeClaimRetentionPolicy:
 | 
			
		||||
    whenDeleted: {{ .Values.ingester.persistence.whenDeleted }}
 | 
			
		||||
    whenScaled: {{ .Values.ingester.persistence.whenScaled }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      {{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
 | 
			
		||||
      name: ingester-zone-c
 | 
			
		||||
      rollout-group: ingester
 | 
			
		||||
{{- with .Values.ingester.updateStrategy }}
 | 
			
		||||
  updateStrategy:
 | 
			
		||||
     {{- tpl (. | toYaml) $ | nindent 4 }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  template:
 | 
			
		||||
    metadata:
 | 
			
		||||
      annotations:
 | 
			
		||||
        {{- include "loki.config.checksum" . | nindent 8 }}
 | 
			
		||||
        {{- with .Values.loki.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.zoneAwareReplication.zoneC.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      labels:
 | 
			
		||||
        {{- include "loki.ingesterSelectorLabels" . | nindent 8 }}
 | 
			
		||||
        app.kubernetes.io/part-of: memberlist
 | 
			
		||||
        name: ingester-zone-c
 | 
			
		||||
        rollout-group: ingester
 | 
			
		||||
        {{- with .Values.loki.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
    spec:
 | 
			
		||||
      {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
 | 
			
		||||
      {{- with .Values.ingester.topologySpreadConstraints }}
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      serviceAccountName: {{ include "loki.serviceAccountName" . }}
 | 
			
		||||
      {{- with .Values.imagePullSecrets }}
 | 
			
		||||
      imagePullSecrets:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.hostAliases }}
 | 
			
		||||
      hostAliases:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- include "loki.ingesterPriorityClassName" . | nindent 6 }}
 | 
			
		||||
      securityContext:
 | 
			
		||||
        {{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
 | 
			
		||||
      terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
 | 
			
		||||
      {{- with .Values.ingester.initContainers }}
 | 
			
		||||
      initContainers:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      containers:
 | 
			
		||||
        - name: ingester
 | 
			
		||||
          image: {{ include "loki.image" . }}
 | 
			
		||||
          imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
 | 
			
		||||
          {{- if or .Values.loki.command .Values.ingester.command }}
 | 
			
		||||
          command:
 | 
			
		||||
            - {{ coalesce .Values.ingester.command .Values.loki.command | quote }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          args:
 | 
			
		||||
            - -config.file=/etc/loki/config/config.yaml
 | 
			
		||||
            - -ingester.availability-zone=zone-c
 | 
			
		||||
            - -ingester.unregister-on-shutdown=false
 | 
			
		||||
            - -ingester.tokens-file-path=/var/loki/ring-tokens
 | 
			
		||||
            - -target=ingester
 | 
			
		||||
            {{- with .Values.ingester.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.ingester.extraEnv }}
 | 
			
		||||
          env:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.extraEnvFrom }}
 | 
			
		||||
          envFrom:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          securityContext:
 | 
			
		||||
            {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
 | 
			
		||||
          {{- include "loki.ingester.readinessProbe" . | nindent 10 }}
 | 
			
		||||
          {{- include "loki.ingester.livenessProbe" . | nindent 10 }}
 | 
			
		||||
          volumeMounts:
 | 
			
		||||
            - 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.ingester.extraVolumeMounts }}
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
            {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.resources }}
 | 
			
		||||
          resources:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.lifecycle }}
 | 
			
		||||
          lifecycle:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.extraContainers }}
 | 
			
		||||
        {{- toYaml .Values.ingester.extraContainers | nindent 8}}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      affinity:
 | 
			
		||||
        podAntiAffinity:
 | 
			
		||||
          requiredDuringSchedulingIgnoredDuringExecution:
 | 
			
		||||
            - labelSelector:
 | 
			
		||||
                matchExpressions:
 | 
			
		||||
                  - key: rollout-group
 | 
			
		||||
                    operator: In
 | 
			
		||||
                    values:
 | 
			
		||||
                      - ingester
 | 
			
		||||
                  - key: name
 | 
			
		||||
                    operator: NotIn
 | 
			
		||||
                    values:
 | 
			
		||||
                      - ingester-zone-c
 | 
			
		||||
              topologyKey: kubernetes.io/hostname
 | 
			
		||||
        {{- with .Values.ingester.zoneAwareReplication.zoneC.extraAffinity }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.zoneAwareReplication.zoneC.nodeSelector }}
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.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.ingester.extraVolumes }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- if not .Values.ingester.persistence.enabled }}
 | 
			
		||||
        - name: data
 | 
			
		||||
          emptyDir: {}
 | 
			
		||||
  {{- else if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
        - name: data
 | 
			
		||||
        {{- if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
          emptyDir:
 | 
			
		||||
            medium: Memory
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.persistence.size }}
 | 
			
		||||
            sizeLimit: {{ .Values.ingester.persistence.size }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- else }}
 | 
			
		||||
  volumeClaimTemplates:
 | 
			
		||||
  {{- range .Values.ingester.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 }}
 | 
			
		||||
@@ -0,0 +1,205 @@
 | 
			
		||||
{{- $isDistributed := eq (include "loki.deployment.isDistributed" .) "true" -}}
 | 
			
		||||
{{- if and $isDistributed (or (not .Values.ingester.zoneAwareReplication.enabled) .Values.ingester.zoneAwareReplication.migration.enabled) }}
 | 
			
		||||
apiVersion: apps/v1
 | 
			
		||||
kind: StatefulSet
 | 
			
		||||
metadata:
 | 
			
		||||
  name: {{ include "loki.ingesterFullname" . }}
 | 
			
		||||
  namespace: {{ .Release.Namespace }}
 | 
			
		||||
  labels:
 | 
			
		||||
    {{- include "loki.ingesterLabels" . | nindent 4 }}
 | 
			
		||||
    app.kubernetes.io/part-of: memberlist
 | 
			
		||||
  {{- with .Values.loki.annotations }}
 | 
			
		||||
  annotations:
 | 
			
		||||
    {{- toYaml . | nindent 4 }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
spec:
 | 
			
		||||
{{- if not .Values.ingester.autoscaling.enabled }}
 | 
			
		||||
  replicas: {{ .Values.ingester.replicas }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  podManagementPolicy: Parallel
 | 
			
		||||
{{- with .Values.ingester.updateStrategy }}
 | 
			
		||||
  updateStrategy:
 | 
			
		||||
     {{- tpl (. | toYaml) $ | nindent 4 }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
  serviceName: {{ include "loki.ingesterFullname" . }}-headless
 | 
			
		||||
  revisionHistoryLimit: {{ .Values.loki.revisionHistoryLimit }}
 | 
			
		||||
  {{- if and (semverCompare ">= 1.23-0" (include "loki.kubeVersion" .)) (.Values.ingester.persistence.enableStatefulSetAutoDeletePVC)  }}
 | 
			
		||||
  {{/*
 | 
			
		||||
    Data on the read nodes is easy to replace, so we want to always delete PVCs to make
 | 
			
		||||
    operation easier, and will rely on re-fetching data when needed.
 | 
			
		||||
  */}}
 | 
			
		||||
  persistentVolumeClaimRetentionPolicy:
 | 
			
		||||
    whenDeleted: {{ .Values.ingester.persistence.whenDeleted }}
 | 
			
		||||
    whenScaled: {{ .Values.ingester.persistence.whenScaled }}
 | 
			
		||||
  {{- end }}
 | 
			
		||||
  selector:
 | 
			
		||||
    matchLabels:
 | 
			
		||||
      {{- include "loki.ingesterSelectorLabels" . | nindent 6 }}
 | 
			
		||||
  template:
 | 
			
		||||
    metadata:
 | 
			
		||||
      annotations:
 | 
			
		||||
        {{- include "loki.config.checksum" . | nindent 8 }}
 | 
			
		||||
        {{- with .Values.loki.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podAnnotations }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      labels:
 | 
			
		||||
        {{- include "loki.ingesterSelectorLabels" . | nindent 8 }}
 | 
			
		||||
        app.kubernetes.io/part-of: memberlist
 | 
			
		||||
        {{- with .Values.loki.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- with .Values.ingester.podLabels }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
    spec:
 | 
			
		||||
      {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
 | 
			
		||||
      {{- with .Values.ingester.topologySpreadConstraints }}
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      serviceAccountName: {{ include "loki.serviceAccountName" . }}
 | 
			
		||||
      {{- with .Values.imagePullSecrets }}
 | 
			
		||||
      imagePullSecrets:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.hostAliases }}
 | 
			
		||||
      hostAliases:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- include "loki.ingesterPriorityClassName" . | nindent 6 }}
 | 
			
		||||
      securityContext:
 | 
			
		||||
        {{- toYaml .Values.loki.podSecurityContext | nindent 8 }}
 | 
			
		||||
      terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
 | 
			
		||||
      {{- with .Values.ingester.initContainers }}
 | 
			
		||||
      initContainers:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      containers:
 | 
			
		||||
        - name: ingester
 | 
			
		||||
          image: {{ include "loki.image" . }}
 | 
			
		||||
          imagePullPolicy: {{ .Values.loki.image.pullPolicy }}
 | 
			
		||||
          {{- if or .Values.loki.command .Values.ingester.command }}
 | 
			
		||||
          command:
 | 
			
		||||
            - {{ coalesce .Values.ingester.command .Values.loki.command | quote }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          args:
 | 
			
		||||
            - -config.file=/etc/loki/config/config.yaml
 | 
			
		||||
            - -ingester.availability-zone=zone-default
 | 
			
		||||
            - -target=ingester
 | 
			
		||||
            {{- with .Values.ingester.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.ingester.extraEnv }}
 | 
			
		||||
          env:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.extraEnvFrom }}
 | 
			
		||||
          envFrom:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          securityContext:
 | 
			
		||||
            {{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
 | 
			
		||||
          {{- include "loki.ingester.readinessProbe" . | nindent 10 }}
 | 
			
		||||
          {{- include "loki.ingester.livenessProbe" . | nindent 10 }}
 | 
			
		||||
          volumeMounts:
 | 
			
		||||
            - 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.ingester.extraVolumeMounts }}
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
            {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.resources }}
 | 
			
		||||
          resources:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
          {{- with .Values.ingester.lifecycle }}
 | 
			
		||||
          lifecycle:
 | 
			
		||||
            {{- toYaml . | nindent 12 }}
 | 
			
		||||
          {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.extraContainers }}
 | 
			
		||||
        {{- toYaml .Values.ingester.extraContainers | nindent 8}}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.affinity }}
 | 
			
		||||
      affinity:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.nodeSelector }}
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
      {{- end }}
 | 
			
		||||
      {{- with .Values.ingester.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.ingester.extraVolumes }}
 | 
			
		||||
        {{- toYaml . | nindent 8 }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- if not .Values.ingester.persistence.enabled }}
 | 
			
		||||
        - name: data
 | 
			
		||||
          emptyDir: { }
 | 
			
		||||
  {{- else if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
        - name: data
 | 
			
		||||
        {{- if .Values.ingester.persistence.inMemory }}
 | 
			
		||||
          emptyDir:
 | 
			
		||||
            medium: Memory
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if .Values.ingester.persistence.size }}
 | 
			
		||||
            sizeLimit: {{ .Values.ingester.persistence.size }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
  {{- else }}
 | 
			
		||||
  volumeClaimTemplates:
 | 
			
		||||
  {{- range .Values.ingester.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 }}
 | 
			
		||||
		Reference in New Issue
	
	Block a user