-
Notifications
You must be signed in to change notification settings - Fork 173
Expand file tree
/
Copy pathingester-statefulset.yaml
More file actions
162 lines (162 loc) · 6.37 KB
/
Copy pathingester-statefulset.yaml
File metadata and controls
162 lines (162 loc) · 6.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
{{- if and .Values.ingester.statefulSet.enabled .Values.ingester.enabled -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "cortex.ingesterFullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "cortex.ingesterLabels" . | nindent 4 }}
app.kubernetes.io/part-of: memberlist
annotations:
{{- toYaml .Values.ingester.annotations | nindent 4 }}
spec:
{{- if not .Values.ingester.autoscaling.enabled }}
replicas: {{ .Values.ingester.replicas }}
{{- end }}
selector:
matchLabels:
{{- include "cortex.ingesterSelectorLabels" . | nindent 6 }}
updateStrategy:
{{- toYaml .Values.ingester.statefulStrategy | nindent 4 }}
podManagementPolicy: "{{ .Values.ingester.statefulSet.podManagementPolicy }}"
serviceName: {{ template "cortex.fullname" . }}-ingester-headless
{{- if .Values.ingester.persistentVolume.enabled }}
{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ingester.persistentVolume.retentionPolicy }}
persistentVolumeClaimRetentionPolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: storage
{{- if .Values.ingester.persistentVolume.annotations }}
annotations:
{{ toYaml .Values.ingester.persistentVolume.annotations | nindent 10 }}
{{- end }}
spec:
{{- if .Values.ingester.persistentVolume.storageClass }}
{{- if (eq "-" .Values.ingester.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.ingester.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
accessModes:
{{ toYaml .Values.ingester.persistentVolume.accessModes | nindent 10 }}
resources:
requests:
storage: "{{ .Values.ingester.persistentVolume.size }}"
{{- end }}
template:
metadata:
labels:
{{- include "cortex.ingesterLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.ingester.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include "cortex.configChecksum" . }}
{{- with .Values.ingester.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.ingester.serviceAccount.name | default (include "cortex.serviceAccountName" . ) }}
{{- if .Values.ingester.priorityClassName }}
priorityClassName: {{ .Values.ingester.priorityClassName }}
{{- end }}
{{- if .Values.ingester.securityContext.enabled }}
securityContext: {{- omit .Values.ingester.securityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.ingester.initContainers | nindent 8 }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
nodeSelector:
{{- toYaml .Values.ingester.nodeSelector | nindent 8 }}
{{- if .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml .Values.ingester.topologySpreadConstraints | nindent 8}}
{{- end }}
affinity:
{{- toYaml .Values.ingester.affinity | nindent 8 }}
tolerations:
{{- toYaml .Values.ingester.tolerations | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
volumes:
{{- include "cortex.configVolume" . | nindent 8 }}
- name: runtime-config
configMap:
name: {{ template "cortex.fullname" . }}-runtime-config
{{- if not .Values.ingester.persistentVolume.enabled }}
- name: storage
emptyDir: {}
{{- end }}
{{- if .Values.ingester.extraVolumes }}
{{- toYaml .Values.ingester.extraVolumes | nindent 8 }}
{{- end }}
containers:
{{- if .Values.ingester.extraContainers }}
{{- toYaml .Values.ingester.extraContainers | nindent 8 }}
{{- end }}
- name: ingester
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-target=ingester"
- "-config.file=/etc/cortex/cortex.yaml"
{{- range $key, $value := .Values.ingester.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
{{- if .Values.ingester.extraVolumeMounts }}
{{- toYaml .Values.ingester.extraVolumeMounts | nindent 12}}
{{- end }}
- name: config
mountPath: /etc/cortex
- name: runtime-config
mountPath: /etc/cortex-runtime-config
- name: storage
mountPath: "/data"
{{- with .Values.ingester.persistentVolume.subPath }}
subPath: {{ . }}
{{- end }}
ports:
- name: http-metrics
containerPort: {{ .Values.config.server.http_listen_port }}
protocol: TCP
- name: grpc
containerPort: {{ .Values.config.server.grpc_listen_port }}
protocol: TCP
- name: gossip
containerPort: {{ .Values.config.memberlist.bind_port }}
protocol: TCP
{{- if .Values.ingester.startupProbe }}
startupProbe:
{{- toYaml .Values.ingester.startupProbe | nindent 12 }}
{{- end }}
{{- if .Values.ingester.livenessProbe }}
livenessProbe:
{{- toYaml .Values.ingester.livenessProbe | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.ingester.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.ingester.resources | nindent 12 }}
{{- if .Values.ingester.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.ingester.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.ingester.env }}
env:
{{- toYaml .Values.ingester.env | nindent 12 }}
{{- end }}
{{- with .Values.ingester.lifecycle }}
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end -}}