-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathquerycoord-deployment.yaml
More file actions
235 lines (231 loc) · 8.93 KB
/
Copy pathquerycoord-deployment.yaml
File metadata and controls
235 lines (231 loc) · 8.93 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
{{- if and .Values.queryCoordinator.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.querycoord.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "querycoord"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.queryCoordinator.replicas) 0 }}
replicas: {{ .Values.queryCoordinator.replicas }}
{{- end }}
{{- if .Values.queryCoordinator.activeStandby.enabled}}
{{- with .Values.queryCoordinator.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
strategy:
type: Recreate
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "querycoord"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
{{ include "milvus.ud.labels" . | indent 8 }}
component: "querycoord"
annotations:
{{- if .Values.queryCoordinator.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.querycoord.fullname" . }}
pyroscope.io/port: "9091"
{{- end }}
{{- if .Values.queryCoordinator.annotations }}
{{- toYaml .Values.queryCoordinator.annotations | nindent 8 }}
{{- end }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{ include "milvus.ud.annotations" . | indent 8 }}
spec:
serviceAccountName: {{ include "milvus.serviceAccount" . }}
{{- if .Values.image.all.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.all.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
initContainers:
{{- if .Values.queryCoordinator.heaptrack.enabled }}
- name: heaptrack
command:
- /bin/bash
- -c
- "cp -r /opt/heaptrack /milvus/tools"
image: "{{ .Values.heaptrack.image.repository }}:{{ .Values.heaptrack.image.tag }}"
imagePullPolicy: {{ .Values.heaptrack.image.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.queryCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.queryCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.queryCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: querycoord
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.queryCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.queryCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.queryCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
{{- if .Values.queryCoordinator.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "querycoord" ]
{{- else }}
args: [ "milvus", "run", "querycoord" ]
{{- end }}
env:
{{- if and .Values.streaming .Values.streaming.enabled }}
- name: MILVUS_STREAMING_SERVICE_ENABLED
value: "1"
{{- end }}
{{- if .Values.queryCoordinator.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.queryCoordinator.extraEnv }}
{{- toYaml .Values.queryCoordinator.extraEnv | nindent 8 }}
{{- end }}
{{- if and .Values.externalS3.enabled .Values.externalS3.existingSecret.enabled }}
- name: MINIO_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: {{ .Values.externalS3.existingSecret.name }}
key: {{ .Values.externalS3.existingSecret.accessKey }}
- name: MINIO_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ .Values.externalS3.existingSecret.name }}
key: {{ .Values.externalS3.existingSecret.secretKey }}
{{- end }}
ports:
- name: querycoord
containerPort: 19531
protocol: TCP
- name: metrics
containerPort: 9091
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
tcpSocket:
port: metrics
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /healthz
port: metrics
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
resources:
{{- toYaml .Values.queryCoordinator.resources | nindent 10 }}
volumeMounts:
{{- if .Values.customConfigMap }}
- name: milvus-config
mountPath: /milvus/configs/user.yaml
subPath: milvus.yaml
readOnly: true
{{- else }}
- name: milvus-config
mountPath: /milvus/configs/default.yaml
subPath: default.yaml
readOnly: true
- name: milvus-config
mountPath: /milvus/configs/user.yaml
subPath: user.yaml
readOnly: true
{{- end }}
{{- if .Values.log.persistence.enabled }}
- name: milvus-logs-disk
mountPath: {{ .Values.log.persistence.mountPath | quote }}
subPath: {{ .Values.log.persistence.persistentVolumeClaim.subPath | default "" }}
{{- end }}
- mountPath: /milvus/tools
name: tools
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 8 }}
{{- end}}
{{- if and (.Values.nodeSelector) (not .Values.queryCoordinator.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.queryCoordinator.nodeSelector }}
nodeSelector:
{{ toYaml .Values.queryCoordinator.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.queryCoordinator.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.queryCoordinator.affinity }}
affinity:
{{ toYaml .Values.queryCoordinator.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.queryCoordinator.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.queryCoordinator.tolerations }}
tolerations:
{{ toYaml .Values.queryCoordinator.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.queryCoordinator.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.queryCoordinator.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.queryCoordinator.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.queryCoordinator.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.queryCoordinator.securityContext }}
securityContext:
{{ toYaml .Values.queryCoordinator.securityContext | indent 8 }}
{{- end }}
volumes:
- name: milvus-config
configMap:
{{- if .Values.customConfigMap }}
name: {{ .Values.customConfigMap }}
{{- else }}
name: {{ template "milvus.fullname" . }}
{{- end }}
{{- if .Values.log.persistence.enabled }}
- name: milvus-logs-disk
persistentVolumeClaim:
claimName: {{ .Values.log.persistence.persistentVolumeClaim.existingClaim | default (printf "%s-logs" (include "milvus.fullname" . | trunc 58)) }}
{{- end }}
- name: tools
emptyDir: {}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 6 }}
{{- end}}
{{- end }}