You've already forked DataMate
222 lines
7.9 KiB
YAML
222 lines
7.9 KiB
YAML
{{- if and .Values.proxy.enabled .Values.cluster.enabled }}
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "milvus.proxy.fullname" . }}
|
|
namespace: {{ .Release.Namespace }}
|
|
labels:
|
|
{{ include "milvus.labels" . | indent 4 }}
|
|
component: "proxy"
|
|
|
|
{{ include "milvus.ud.labels" . | indent 4 }}
|
|
annotations:
|
|
{{ include "milvus.ud.annotations" . | indent 4 }}
|
|
|
|
spec:
|
|
{{- if ge (int .Values.proxy.replicas) 0 }}
|
|
replicas: {{ .Values.proxy.replicas }}
|
|
{{- end }}
|
|
{{- with .Values.proxy.strategy }}
|
|
strategy:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{ include "milvus.matchLabels" . | indent 6 }}
|
|
component: "proxy"
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{ include "milvus.matchLabels" . | indent 8 }}
|
|
component: "proxy"
|
|
{{ include "milvus.ud.labels" . | indent 8 }}
|
|
annotations:
|
|
{{- if .Values.proxy.profiling.enabled }}
|
|
pyroscope.io/scrape: "true"
|
|
pyroscope.io/application-name: {{ template "milvus.proxy.fullname" . }}
|
|
pyroscope.io/port: "9091"
|
|
{{- end }}
|
|
{{- if .Values.proxy.annotations }}
|
|
{{- toYaml .Values.proxy.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.proxy.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.proxy.containerSecurityContext) }}
|
|
securityContext:
|
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
|
{{ end }}
|
|
{{ if .Values.proxy.containerSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml .Values.proxy.containerSecurityContext | nindent 12 }}
|
|
{{ end }}
|
|
volumeMounts:
|
|
- mountPath: /milvus/tools
|
|
name: tools
|
|
{{- end }}
|
|
containers:
|
|
- name: proxy
|
|
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
|
|
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
|
|
{{ if and (.Values.containerSecurityContext) (not .Values.proxy.containerSecurityContext) }}
|
|
securityContext:
|
|
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
|
{{ end }}
|
|
{{ if .Values.proxy.containerSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml .Values.proxy.containerSecurityContext | nindent 12 }}
|
|
{{ end }}
|
|
{{- if .Values.proxy.heaptrack.enabled }}
|
|
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "proxy" ]
|
|
{{- else }}
|
|
args: [ "milvus", "run", "proxy" ]
|
|
{{- end }}
|
|
env:
|
|
{{- if .Values.proxy.heaptrack.enabled }}
|
|
- name: LD_LIBRARY_PATH
|
|
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
|
|
{{- end }}
|
|
{{- if .Values.proxy.extraEnv }}
|
|
{{- toYaml .Values.proxy.extraEnv | nindent 8 }}
|
|
{{- end }}
|
|
ports:
|
|
- name: milvus
|
|
containerPort: 19530
|
|
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.proxy.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.proxy.volumeMounts }}
|
|
{{- toYaml .Values.proxy.volumeMounts | nindent 8 }}
|
|
{{- end}}
|
|
{{- if .Values.volumeMounts }}
|
|
{{- toYaml .Values.volumeMounts | nindent 8 }}
|
|
{{- end}}
|
|
|
|
{{- if and (.Values.nodeSelector) (not .Values.proxy.nodeSelector) }}
|
|
nodeSelector:
|
|
{{ toYaml .Values.nodeSelector | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.proxy.nodeSelector }}
|
|
nodeSelector:
|
|
{{ toYaml .Values.proxy.nodeSelector | indent 8 }}
|
|
{{- end }}
|
|
{{- if and (.Values.affinity) (not .Values.proxy.affinity) }}
|
|
affinity:
|
|
{{ toYaml .Values.affinity | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.proxy.affinity }}
|
|
affinity:
|
|
{{ toYaml .Values.proxy.affinity | indent 8 }}
|
|
{{- end }}
|
|
{{- if and (.Values.tolerations) (not .Values.proxy.tolerations) }}
|
|
tolerations:
|
|
{{ toYaml .Values.tolerations | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.proxy.tolerations }}
|
|
tolerations:
|
|
{{ toYaml .Values.proxy.tolerations | indent 8 }}
|
|
{{- end }}
|
|
|
|
{{- if and (.Values.topologySpreadConstraints) (not .Values.proxy.topologySpreadConstraints) }}
|
|
topologySpreadConstraints:
|
|
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.proxy.topologySpreadConstraints }}
|
|
topologySpreadConstraints:
|
|
{{ toYaml .Values.proxy.topologySpreadConstraints | indent 8 }}
|
|
{{- end }}
|
|
{{- if and (.Values.securityContext) (not .Values.proxy.securityContext) }}
|
|
securityContext:
|
|
{{ toYaml .Values.securityContext | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.proxy.securityContext }}
|
|
securityContext:
|
|
{{ toYaml .Values.proxy.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.proxy.volumes }}
|
|
{{ toYaml .Values.proxy.volumes | indent 6 }}
|
|
{{- end}}
|
|
{{- if .Values.volumes }}
|
|
{{- toYaml .Values.volumes | nindent 6 }}
|
|
{{- end}}
|
|
{{- end }}
|