You've already forked DataMate
216
deployment/helm/milvus/templates/mixcoord-deployment.yaml
Normal file
216
deployment/helm/milvus/templates/mixcoord-deployment.yaml
Normal file
@@ -0,0 +1,216 @@
|
||||
{{- if and .Values.mixCoordinator.enabled .Values.cluster.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "milvus.mixcoord.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{ include "milvus.labels" . | indent 4 }}
|
||||
component: "mixcoord"
|
||||
{{ include "milvus.ud.labels" . | indent 4 }}
|
||||
annotations:
|
||||
{{ include "milvus.ud.annotations" . | indent 4 }}
|
||||
|
||||
spec:
|
||||
{{- if ge (int .Values.mixCoordinator.replicas) 0 }}
|
||||
replicas: {{ .Values.mixCoordinator.replicas }}
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.activeStandby.enabled}}
|
||||
{{- with .Values.mixCoordinator.strategy }}
|
||||
strategy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
strategy:
|
||||
type: Recreate
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{ include "milvus.matchLabels" . | indent 6 }}
|
||||
component: "mixcoord"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{ include "milvus.matchLabels" . | indent 8 }}
|
||||
{{ include "milvus.ud.labels" . | indent 8 }}
|
||||
component: "mixcoord"
|
||||
annotations:
|
||||
{{- if .Values.mixCoordinator.profiling.enabled }}
|
||||
pyroscope.io/scrape: "true"
|
||||
pyroscope.io/application-name: {{ template "milvus.mixcoord.fullname" . }}
|
||||
pyroscope.io/port: "9091"
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.annotations }}
|
||||
{{- toYaml .Values.mixCoordinator.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.mixCoordinator.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.mixCoordinator.containerSecurityContext) }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
{{ if .Values.mixCoordinator.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.mixCoordinator.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
volumeMounts:
|
||||
- mountPath: /milvus/tools
|
||||
name: tools
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: mixcoord
|
||||
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
|
||||
{{ if and (.Values.containerSecurityContext) (not .Values.mixCoordinator.containerSecurityContext) }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
{{ if .Values.mixCoordinator.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.mixCoordinator.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
{{- if .Values.mixCoordinator.heaptrack.enabled }}
|
||||
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "mixture", "-rootcoord", "-querycoord", "-datacoord", "-indexcoord" ]
|
||||
{{- else }}
|
||||
args: [ "milvus", "run", "mixture", "-rootcoord", "-querycoord", "-datacoord", "-indexcoord" ]
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if .Values.mixCoordinator.heaptrack.enabled }}
|
||||
- name: LD_LIBRARY_PATH
|
||||
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.extraEnv }}
|
||||
{{- toYaml .Values.mixCoordinator.extraEnv | nindent 8 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- 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.mixCoordinator.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.mixCoordinator.nodeSelector) }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.mixCoordinator.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.affinity) (not .Values.mixCoordinator.affinity) }}
|
||||
affinity:
|
||||
{{ toYaml .Values.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.mixCoordinator.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.tolerations) (not .Values.mixCoordinator.tolerations) }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.mixCoordinator.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and (.Values.topologySpreadConstraints) (not .Values.mixCoordinator.topologySpreadConstraints) }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml .Values.mixCoordinator.topologySpreadConstraints | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.securityContext) (not .Values.mixCoordinator.securityContext) }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.mixCoordinator.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.mixCoordinator.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 }}
|
||||
Reference in New Issue
Block a user