You've already forked DataMate
232
deployment/helm/milvus/templates/standalone-deployment.yaml
Normal file
232
deployment/helm/milvus/templates/standalone-deployment.yaml
Normal file
@@ -0,0 +1,232 @@
|
||||
{{- if not .Values.cluster.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "milvus.standalone.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{ include "milvus.labels" . | indent 4 }}
|
||||
component: "standalone"
|
||||
{{ include "milvus.ud.labels" . | indent 4 }}
|
||||
annotations:
|
||||
{{ include "milvus.ud.annotations" . | indent 4 }}
|
||||
milvus.io/message-queue: {{ template "milvus.standalone.messageQueue" . }}
|
||||
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
{{ include "milvus.matchLabels" . | indent 6 }}
|
||||
component: "standalone"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{ include "milvus.matchLabels" . | indent 8 }}
|
||||
component: "standalone"
|
||||
{{ include "milvus.ud.labels" . | indent 8 }}
|
||||
annotations:
|
||||
{{- if .Values.standalone.profiling.enabled }}
|
||||
pyroscope.io/scrape: "true"
|
||||
pyroscope.io/application-name: {{ template "milvus.standalone.fullname" . }}
|
||||
pyroscope.io/port: "9091"
|
||||
{{- 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.standalone.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.standalone.containerSecurityContext) }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
{{ if .Values.standalone.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.standalone.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
volumeMounts:
|
||||
- mountPath: /milvus/tools
|
||||
name: tools
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: standalone
|
||||
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
|
||||
{{ if and (.Values.containerSecurityContext) (not .Values.standalone.containerSecurityContext) }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
{{ if .Values.standalone.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.standalone.containerSecurityContext | nindent 12 }}
|
||||
{{ end }}
|
||||
{{- if .Values.standalone.heaptrack.enabled }}
|
||||
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "standalone" ]
|
||||
{{- else }}
|
||||
args: [ "milvus", "run", "standalone" ]
|
||||
{{- 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.standalone.resources | nindent 10 }}
|
||||
env:
|
||||
{{- if .Values.standalone.heaptrack.enabled }}
|
||||
- name: LD_LIBRARY_PATH
|
||||
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.disk.size.enabled }}
|
||||
- name: LOCAL_STORAGE_SIZE
|
||||
valueFrom:
|
||||
resourceFieldRef:
|
||||
divisor: 1Gi
|
||||
resource: limits.ephemeral-storage
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.extraEnv }}
|
||||
{{- toYaml .Values.standalone.extraEnv | nindent 8 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- mountPath: /milvus/tools
|
||||
name: tools
|
||||
{{- 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 }}
|
||||
- name: milvus-data-disk
|
||||
mountPath: {{ .Values.standalone.persistence.mountPath | quote }}
|
||||
subPath: {{ .Values.standalone.persistence.persistentVolumeClaim.subPath | default "" }}
|
||||
{{- if .Values.log.persistence.enabled }}
|
||||
- name: milvus-logs-disk
|
||||
mountPath: {{ .Values.log.persistence.mountPath | quote }}
|
||||
subPath: {{ .Values.log.persistence.persistentVolumeClaim.subPath | default "" }}
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.disk.enabled }}
|
||||
- mountPath: /var/lib/milvus/data
|
||||
name: disk
|
||||
{{- end }}
|
||||
{{- if .Values.volumeMounts }}
|
||||
{{- toYaml .Values.volumeMounts | nindent 8 }}
|
||||
{{- end}}
|
||||
|
||||
{{- if and (.Values.nodeSelector) (not .Values.standalone.nodeSelector) }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.standalone.nodeSelector | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.affinity) (not .Values.standalone.affinity) }}
|
||||
affinity:
|
||||
{{ toYaml .Values.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.affinity }}
|
||||
affinity:
|
||||
{{ toYaml .Values.standalone.affinity | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.tolerations) (not .Values.standalone.tolerations) }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.standalone.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.topologySpreadConstraints) (not .Values.standalone.topologySpreadConstraints) }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml .Values.standalone.topologySpreadConstraints | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (.Values.securityContext) (not .Values.standalone.securityContext) }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.standalone.securityContext }}
|
||||
securityContext:
|
||||
{{ toYaml .Values.standalone.securityContext | indent 8 }}
|
||||
{{- end }}
|
||||
|
||||
volumes:
|
||||
- emptyDir: {}
|
||||
name: tools
|
||||
- name: milvus-config
|
||||
configMap:
|
||||
{{- if .Values.customConfigMap }}
|
||||
name: {{ .Values.customConfigMap }}
|
||||
{{- else }}
|
||||
name: {{ template "milvus.fullname" . }}
|
||||
{{- end }}
|
||||
- name: milvus-data-disk
|
||||
{{- if .Values.standalone.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.standalone.persistence.persistentVolumeClaim.existingClaim | default (printf "%s" (include "milvus.fullname" . | trunc 58)) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- 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 }}
|
||||
{{- if .Values.standalone.disk.enabled }}
|
||||
- name: disk
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.volumes }}
|
||||
{{- toYaml .Values.volumes | nindent 6 }}
|
||||
{{- end}}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user