blob: d1046d80237aa037f958b479a2f674d9b25773be [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001{{- if (eq .Values.role "Aggregator") -}}
2apiVersion: apps/v1
3kind: StatefulSet
4metadata:
5 name: {{ include "vector.fullname" . }}
6 labels:
7 {{- include "vector.labels" . | nindent 4 }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -03008 annotations:
9 {{- toYaml .Values.workloadResourceAnnotations | nindent 4 }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000010spec:
Mohammed Naser7d1623e2024-06-17 09:12:39 -040011 {{- if not (or .Values.autoscaling.enabled .Values.autoscaling.external) }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000012 replicas: {{ .Values.replicas }}
13 {{- end }}
14 podManagementPolicy: {{ .Values.podManagementPolicy }}
15 selector:
16 matchLabels:
17 {{- include "vector.selectorLabels" . | nindent 6 }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030018 {{- if semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion }}
19 minReadySeconds: {{ .Values.minReadySeconds }}
20 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000021 {{- with .Values.updateStrategy }}
22 updateStrategy:
23 {{- toYaml . | nindent 4 }}
24 {{- end }}
25 serviceName: {{ template "vector.fullname" . }}-headless
26 template:
27 metadata:
28 annotations:
29 {{- if .Values.rollWorkload }}
30 {{- if .Values.existingConfigMaps }}
31 {{- range .Values.existingConfigMaps }}
32 {{- range $file, $contents := (lookup "v1" "ConfigMap" (print $.Release.Namespace) (print .)).data }}
33 checksum/{{ $file }}: {{ $contents | sha256sum }}
34 {{- end }}
35 {{- end }}
36 {{- else }}
37 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
38 {{- end }}
39 {{- end }}
40 {{- with .Values.podAnnotations }}
41 {{- toYaml . | nindent 8 }}
42 {{- end }}
43 labels:
44 {{- include "vector.selectorLabels" . | nindent 8 }}
45 {{- with .Values.podLabels }}
46 {{- toYaml . | nindent 8 }}
47 {{- end }}
48 spec:
49 {{- include "vector.pod" . | nindent 6 }}
50 volumeClaimTemplates:
51{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
52 - metadata:
53 name: data
54 spec:
55 accessModes: {{ .Values.persistence.accessModes }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030056 {{- if .Values.persistence.storageClassName }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000057 storageClassName: {{ .Values.persistence.storageClassName }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030058 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000059 resources:
60 requests:
61 storage: {{ .Values.persistence.size }}
62 {{- with .Values.persistence.selector }}
63 selector:
64{{ toYaml . | indent 8 }}
65 {{- end }}
66{{- end }}
67{{- end }}