feature: 对接deer-flow (#54)

feature: 对接deer-flow
This commit is contained in:
hhhhsc701
2025-11-04 20:30:40 +08:00
committed by GitHub
parent dc30b0d892
commit f3958f08d9
710 changed files with 112812 additions and 52 deletions

View File

@@ -0,0 +1,248 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "milvus.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "milvus.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create a default fully qualified standalone name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.standalone.fullname" -}}
{{ template "milvus.fullname" . }}-standalone
{{- end -}}
{{/*
Create a default fully qualified Root Coordinator name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.rootcoord.fullname" -}}
{{ template "milvus.fullname" . }}-rootcoord
{{- end -}}
{{/*
Create a default fully qualified Proxy name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.proxy.fullname" -}}
{{ template "milvus.fullname" . }}-proxy
{{- end -}}
{{/*
Create a default fully qualified Query Coordinator name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.querycoord.fullname" -}}
{{ template "milvus.fullname" . }}-querycoord
{{- end -}}
{{/*
Create a default fully qualified Query Node name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.querynode.fullname" -}}
{{ template "milvus.fullname" . }}-querynode
{{- end -}}
{{/*
Create a default fully qualified Index Coordinator name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.indexcoord.fullname" -}}
{{ template "milvus.fullname" . }}-indexcoord
{{- end -}}
{{/*
Create a default fully qualified Index Node name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.indexnode.fullname" -}}
{{ template "milvus.fullname" . }}-indexnode
{{- end -}}
{{/*
Create a default fully qualified Data Coordinator name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.datacoord.fullname" -}}
{{ template "milvus.fullname" . }}-datacoord
{{- end -}}
{{/*
Create a default fully qualified Data Node name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.datanode.fullname" -}}
{{ template "milvus.fullname" . }}-datanode
{{- end -}}
{{/*
Create a default fully qualified Mixture Coordinator name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.mixcoord.fullname" -}}
{{ template "milvus.fullname" . }}-mixcoord
{{- end -}}
{{/*
Create a default fully qualified Streaming Node name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.streamingnode.fullname" -}}
{{ template "milvus.fullname" . }}-streamingnode
{{- end -}}
{{/*
Create a default fully qualified pulsar name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.pulsar.fullname" -}}
{{- $name := .Values.pulsar.name -}}
{{- if contains $name .Release.Name -}}
{{ .Release.Name }}
{{- else -}}
{{ .Release.Name }}-pulsar
{{- end -}}
{{- end -}}
{{/*
Create a default fully qualified attu name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "milvus.attu.fullname" -}}
{{ template "milvus.fullname" . }}-attu
{{- end -}}
{{/*
Create the name of the service account to use for the Milvus components
*/}}
{{- define "milvus.serviceAccount" -}}
{{- if .Values.serviceAccount.create -}}
{{ default "milvus" .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create milvus attu env name.
*/}}
{{- define "milvus.attu.env" -}}
- name: MILVUS_URL
value: http://{{ template "milvus.fullname" .}}:19530
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "milvus.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* Helm required labels */}}
{{- define "milvus.labels" -}}
helm.sh/chart: {{ include "milvus.chart" . }}
{{ include "milvus.matchLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/* labels defined by user*/}}
{{- define "milvus.ud.labels" -}}
{{- if .Values.labels }}
{{- toYaml .Values.labels }}
{{- end -}}
{{- end -}}
{{/* annotations defined by user*/}}
{{- define "milvus.ud.annotations" -}}
{{- if .Values.annotations }}
{{- toYaml .Values.annotations }}
{{- end -}}
{{- end -}}
{{/* matchLabels */}}
{{- define "milvus.matchLabels" -}}
app.kubernetes.io/name: {{ include "milvus.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/* define rootcoord activeStandby */}}
{{- define "milvus.rootcoord.activeStandby" -}}
{{- if or .Values.rootCoordinator.activeStandby.enabled (and .Values.mixCoordinator.enabled .Values.mixCoordinator.activeStandby.enabled) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}
{{/* define querycoord activeStandby */}}
{{- define "milvus.querycoord.activeStandby" -}}
{{- if or .Values.queryCoordinator.activeStandby.enabled (and .Values.mixCoordinator.enabled .Values.mixCoordinator.activeStandby.enabled) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}
{{/* define indexcoord activeStandby */}}
{{- define "milvus.indexcoord.activeStandby" -}}
{{- if or .Values.indexCoordinator.activeStandby.enabled (and .Values.mixCoordinator.enabled .Values.mixCoordinator.activeStandby.enabled) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}
{{/* define datacoord activeStandby */}}
{{- define "milvus.datacoord.activeStandby" -}}
{{- if or .Values.dataCoordinator.activeStandby.enabled (and .Values.mixCoordinator.enabled .Values.mixCoordinator.activeStandby.enabled) -}}
true
{{- else -}}
false
{{- end -}}
{{- end -}}
{{/* define milvus.standalone.messageQueue */}}
{{- define "milvus.standalone.messageQueue" -}}
{{/* first time deploy or specified non default mq in values, use it directly */}}
{{- $inputStandaloneMQ := .Values.standalone.messageQueue -}}
{{- if or (ne "woodpecker" $inputStandaloneMQ) (eq .Release.Revision 1) -}}
{{ $inputStandaloneMQ }}
{{- else -}}
{{- $standaloneDeployName := include "milvus.standalone.fullname" . -}}
{{- $standaloneDeploy := (lookup "apps/v1" "Deployment" .Release.Namespace $standaloneDeployName) -}}
{{- if not $standaloneDeploy -}}
{{ $inputStandaloneMQ }}
{{- else -}}
{{- $standaloneMQAnnotation := get $standaloneDeploy.metadata.annotations "milvus.io/message-queue" -}}
{{- if and $standaloneMQAnnotation (ne "" $standaloneMQAnnotation) -}}
{{ $standaloneMQAnnotation }}
{{- else -}}
"rocksmq"
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,92 @@
{{- if .Values.attu.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.attu.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "attu"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "attu"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "attu"
{{ include "milvus.ud.labels" . | indent 8 }}
{{- if .Values.attu.podLabels }}
{{ toYaml .Values.attu.podLabels | indent 8 }}
{{- end }}
annotations:
{{- if .Values.attu.annotations }}
{{- toYaml .Values.attu.annotations | nindent 8 }}
{{- end }}
{{ include "milvus.ud.annotations" . | indent 8 }}
spec:
{{- if .Values.attu.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.attu.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: attu
image: {{ .Values.attu.image.repository }}:{{ .Values.attu.image.tag }}
imagePullPolicy: {{ .Values.attu.image.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.attu.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.attu.containerSecurityContext }}
securityContext:
{{- toYaml .Values.attu.containerSecurityContext | nindent 12 }}
{{ end }}
ports:
- name: attu
containerPort: 3000
protocol: TCP
env:
{{ include "milvus.attu.env" . | indent 8}}
resources:
{{- toYaml .Values.attu.resources | nindent 10 }}
{{- if and (.Values.affinity) (not .Values.attu.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.attu.affinity }}
affinity:
{{ toYaml .Values.attu.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.attu.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.attu.tolerations }}
tolerations:
{{ toYaml .Values.attu.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.nodeSelector) (not .Values.attu.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.attu.nodeSelector }}
nodeSelector:
{{ toYaml .Values.attu.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.attu.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.attu.securityContext }}
securityContext:
{{ toYaml .Values.attu.securityContext | indent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,101 @@
{{- if and .Values.attu.enabled .Values.attu.ingress.enabled }}
{{- $attuServiceName := include "milvus.attu.fullname" . -}}
{{- $attuServicePort := .Values.attu.service.port -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "milvus.attu.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.attu.ingress.labels }}
{{ toYaml .Values.attu.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.attu.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.attu.ingress.ingressClassName }}
ingressClassName: {{ .Values.attu.ingress.ingressClassName }}
{{- end }}
{{- if .Values.attu.ingress.tls }}
tls:
{{- range .Values.attu.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
defaultBackend:
service:
name: {{ $attuServiceName }}
port:
number: {{ $attuServicePort }}
{{- end }}
{{- if .Values.attu.ingress.hosts }}
rules:
{{- range $host := .Values.attu.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $attuServiceName }}
port:
number: {{ $attuServicePort }}
{{- end }}
{{- end }}
{{- else }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "milvus.attu.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.attu.ingress.labels }}
{{ toYaml .Values.attu.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.attu.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.attu.ingress.tls }}
tls:
{{- range .Values.attu.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
backend:
serviceName: {{ $attuServiceName }}
servicePort: {{ $attuServicePort }}
{{- end }}
{{- if .Values.attu.ingress.hosts }}
rules:
{{- range $host := .Values.attu.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
pathType: Prefix
backend:
serviceName: {{ $attuServiceName }}
servicePort: {{ $attuServicePort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,32 @@
{{- if and .Values.attu.enabled .Values.attu.route.enabled }}
{{- $attuServiceName := include "milvus.attu.fullname" . -}}
{{- $attuServicePort := .Values.attu.service.port -}}
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: {{ template "milvus.attu.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.attu.route.labels }}
{{ toYaml .Values.attu.route.labels | indent 4 }}
{{- end }}
{{- with .Values.attu.route.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.attu.route.host }}
host: {{ .Values.attu.route.host }}
{{- end }}
port:
targetPort: {{ $attuServicePort }}
to:
kind: Service
name: {{ $attuServiceName }}
weight: 100
{{- if .Values.attu.route.tls }}
tls:
{{- toYaml .Values.attu.route.tls | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,43 @@
{{- if .Values.attu.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.attu.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.attu.service.labels }}
{{ toYaml .Values.attu.service.labels | indent 4 }}
{{- end }}
component: "attu"
{{- if .Values.attu.service.annotations }}
annotations:
{{ toYaml .Values.attu.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.attu.service.type "ClusterIP") (empty .Values.attu.service.type)) }}
type: ClusterIP
{{- if .Values.attu.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- else if eq .Values.attu.service.type "LoadBalancer" }}
type: LoadBalancer
{{- if .Values.attu.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.attu.service.loadBalancerIP }}
{{- end }}
{{- if .Values.attu.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.attu.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.attu.service.type }}
{{- end }}
ports:
- name: attu
protocol: TCP
port: {{ .Values.attu.service.port }}
targetPort: 3000
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
component: "attu"
{{- end }}

View File

@@ -0,0 +1,255 @@
{{- define "milvus.config" -}}
# Copyright (C) 2019-2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
{{- $etcdReleaseName := "" -}}
{{- if contains .Values.etcd.name .Release.Name }}
{{- $etcdReleaseName = printf "%s" .Release.Name -}}
{{- else }}
{{- $etcdReleaseName = printf "%s-%s" .Release.Name .Values.etcd.name -}}
{{- end }}
{{- $etcdPort := .Values.etcd.service.port }}
{{- $namespace := .Release.Namespace }}
etcd:
{{- if .Values.externalEtcd.enabled }}
endpoints:
{{- range .Values.externalEtcd.endpoints }}
- {{ . }}
{{- end }}
{{- else }}
endpoints:
{{- range $i := until ( .Values.etcd.replicaCount | int ) }}
- {{ $etcdReleaseName }}-{{ $i }}.{{ $etcdReleaseName }}-headless.{{ $namespace }}.svc.{{ $.Values.etcd.clusterDomain }}:{{ $etcdPort }}
{{- end }}
{{- end }}
metastore:
type: etcd
{{- if and (.Values.externalS3.enabled) (eq .Values.externalS3.cloudProvider "azure") }}
common:
storageType: remote
{{- end }}
minio:
{{- if .Values.externalS3.enabled }}
address: {{ .Values.externalS3.host }}
port: {{ .Values.externalS3.port }}
accessKeyID: {{ .Values.externalS3.accessKey }}
secretAccessKey: {{ .Values.externalS3.secretKey }}
useSSL: {{ .Values.externalS3.useSSL }}
bucketName: {{ .Values.externalS3.bucketName }}
rootPath: {{ .Values.externalS3.rootPath }}
useIAM: {{ .Values.externalS3.useIAM }}
cloudProvider: {{ .Values.externalS3.cloudProvider }}
iamEndpoint: {{ .Values.externalS3.iamEndpoint }}
region: {{ .Values.externalS3.region }}
useVirtualHost: {{ .Values.externalS3.useVirtualHost }}
{{- else }}
{{- if contains .Values.minio.name .Release.Name }}
address: {{ .Release.Name }}
{{- else }}
address: {{ .Release.Name }}-{{ .Values.minio.name }}
{{- end }}
port: {{ .Values.minio.service.port }}
accessKeyID: {{ .Values.minio.accessKey }}
secretAccessKey: {{ .Values.minio.secretKey }}
useSSL: {{ .Values.minio.tls.enabled }}
bucketName: {{ .Values.minio.bucketName }}
rootPath: {{ .Values.minio.rootPath }}
useIAM: {{ .Values.minio.useIAM }}
{{- if .Values.minio.useIAM }}
iamEndpoint: {{ .Values.minio.iamEndpoint }}
{{- end }}
{{- if ne .Values.minio.region "" }}
region: {{ .Values.minio.region }}
{{- end }}
useVirtualHost: {{ .Values.minio.useVirtualHost }}
{{- end }}
{{- if .Values.externalPulsar.enabled }}
mq:
type: pulsar
messageQueue: pulsar
pulsar:
address: {{ .Values.externalPulsar.host }}
port: {{ .Values.externalPulsar.port }}
maxMessageSize: {{ .Values.externalPulsar.maxMessageSize }}
tenant: "{{ .Values.externalPulsar.tenant }}"
namespace: {{ .Values.externalPulsar.namespace }}
authPlugin: {{ .Values.externalPulsar.authPlugin }}
authParams: {{ .Values.externalPulsar.authParams }}
{{- else if .Values.pulsar.enabled }}
mq:
type: pulsar
messageQueue: pulsar
pulsar:
{{- if contains .Values.pulsar.name .Release.Name }}
address: {{ .Release.Name }}-proxy
{{- else }}
address: {{ .Release.Name }}-{{ .Values.pulsar.name }}-proxy
{{- end }}
port: {{ .Values.pulsar.proxy.ports.pulsar }}
maxMessageSize: {{ .Values.pulsar.maxMessageSize }}
{{- else if .Values.woodpecker.enabled }}
mq:
type: woodpecker
messageQueue: woodpecker
{{- else if .Values.pulsarv3.enabled }}
mq:
type: pulsar
messageQueue: pulsar
pulsar:
{{- if contains .Values.pulsarv3.name .Release.Name }}
address: {{ .Release.Name }}-proxy
{{- else }}
address: {{ .Release.Name }}-{{ .Values.pulsarv3.name }}-proxy
{{- end }}
port: {{ .Values.pulsarv3.proxy.ports.pulsar }}
maxMessageSize: {{ .Values.pulsarv3.broker.configData.maxMessageSize }}
{{- end }}
{{- if .Values.externalKafka.enabled }}
mq:
type: kafka
messageQueue: kafka
kafka:
brokerList: {{ .Values.externalKafka.brokerList }}
securityProtocol: {{ .Values.externalKafka.securityProtocol }}
saslMechanisms: {{ .Values.externalKafka.sasl.mechanisms }}
{{- if .Values.externalKafka.sasl.username }}
saslUsername: {{ .Values.externalKafka.sasl.username }}
{{- end }}
{{- if .Values.externalKafka.sasl.password }}
saslPassword: {{ .Values.externalKafka.sasl.password }}
{{- end }}
{{- else if .Values.kafka.enabled }}
mq:
type: kafka
messageQueue: kafka
kafka:
{{- if contains .Values.kafka.name .Release.Name }}
brokerList: {{ .Release.Name }}:{{ .Values.kafka.service.ports.client }}
{{- else }}
brokerList: {{ .Release.Name }}-{{ .Values.kafka.name }}:{{ .Values.kafka.service.ports.client }}
{{- end }}
{{- end }}
{{- if not .Values.cluster.enabled }}
{{- if or (eq .Values.standalone.messageQueue "rocksmq") (eq .Values.standalone.messageQueue "natsmq") (eq .Values.standalone.messageQueue "woodpecker") }}
mq:
type: {{ include "milvus.standalone.messageQueue" . }}
messageQueue: {{ include "milvus.standalone.messageQueue" . }}
{{- end }}
{{- end }}
rootCoord:
{{- if .Values.cluster.enabled }}
address: {{ template "milvus.rootcoord.fullname" . }}
{{- else }}
address: localhost
{{- end }}
port: {{ .Values.rootCoordinator.service.port }}
enableActiveStandby: {{ template "milvus.rootcoord.activeStandby" . }} # Enable rootcoord active-standby
proxy:
port: 19530
internalPort: 19529
queryCoord:
{{- if .Values.cluster.enabled }}
address: {{ template "milvus.querycoord.fullname" . }}
{{- else }}
address: localhost
{{- end }}
port: {{ .Values.queryCoordinator.service.port }}
enableActiveStandby: {{ template "milvus.querycoord.activeStandby" . }} # Enable querycoord active-standby
queryNode:
port: 21123
{{- if .Values.cluster.enabled }}
enableDisk: {{ .Values.queryNode.disk.enabled }} # Enable querynode load disk index, and search on disk index
{{- else }}
enableDisk: {{ .Values.standalone.disk.enabled }} # Enable querynode load disk index, and search on disk index
{{- end }}
indexCoord:
{{- if .Values.cluster.enabled }}
address: {{ template "milvus.indexcoord.fullname" . }}
{{- else }}
address: localhost
{{- end }}
port: {{ .Values.indexCoordinator.service.port }}
enableActiveStandby: {{ template "milvus.indexcoord.activeStandby" . }} # Enable indexcoord active-standby
indexNode:
port: 21121
{{- if .Values.cluster.enabled }}
enableDisk: {{ .Values.indexNode.disk.enabled }} # Enable index node build disk vector index
{{- else }}
enableDisk: {{ .Values.standalone.disk.enabled }} # Enable index node build disk vector index
{{- end }}
dataCoord:
{{- if .Values.cluster.enabled }}
address: {{ template "milvus.datacoord.fullname" . }}
{{- else }}
address: localhost
{{- end }}
port: {{ .Values.dataCoordinator.service.port }}
enableActiveStandby: {{ template "milvus.datacoord.activeStandby" . }} # Enable datacoord active-standby
dataNode:
port: 21124
log:
level: {{ .Values.log.level }}
file:
{{- if .Values.log.persistence.enabled }}
rootPath: "{{ .Values.log.persistence.mountPath }}"
{{- else }}
rootPath: ""
{{- end }}
maxSize: {{ .Values.log.file.maxSize }}
maxAge: {{ .Values.log.file.maxAge }}
maxBackups: {{ .Values.log.file.maxBackups }}
format: {{ .Values.log.format }}
{{- end }}

View File

@@ -0,0 +1,16 @@
# If customConfigMap is not set, this ConfigMap will be redendered.
{{- if not .Values.customConfigMap }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "milvus.fullname" . }}
namespace: {{ .Release.Namespace }}
data:
default.yaml: |+
{{- include "milvus.config" . | nindent 4 }}
{{- range $key, $value := .Values.extraConfigFiles }}
{{ $key }}: |-
{{ $value | indent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,223 @@
{{- if and .Values.dataCoordinator.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.datacoord.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "datacoord"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.dataCoordinator.replicas) 0 }}
replicas: {{ .Values.dataCoordinator.replicas }}
{{- end }}
{{- if .Values.dataCoordinator.activeStandby.enabled}}
{{- with .Values.dataCoordinator.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
strategy:
type: Recreate
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "datacoord"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "datacoord"
{{ include "milvus.ud.labels" . | indent 8 }}
annotations:
{{- if .Values.dataCoordinator.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.datacoord.fullname" . }}
pyroscope.io/port: "9091"
{{- end }}
{{- if .Values.dataCoordinator.annotations }}
{{- toYaml .Values.dataCoordinator.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.dataCoordinator.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.dataCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.dataCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.dataCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: datacoord
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{- if .Values.dataCoordinator.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "datacoord" ]
{{- else }}
args: [ "milvus", "run", "datacoord" ]
{{- end }}
env:
{{- if and .Values.streaming .Values.streaming.enabled }}
- name: MILVUS_STREAMING_SERVICE_ENABLED
value: "1"
{{- end }}
{{- if .Values.dataCoordinator.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.dataCoordinator.extraEnv }}
{{- toYaml .Values.dataCoordinator.extraEnv | nindent 8 }}
{{- end }}
{{ if and (.Values.containerSecurityContext) (not .Values.dataCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.dataCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.dataCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
ports:
- name: datacoord
containerPort: 13333
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.dataCoordinator.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.dataCoordinator.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.dataCoordinator.nodeSelector }}
nodeSelector:
{{ toYaml .Values.dataCoordinator.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.dataCoordinator.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.dataCoordinator.affinity }}
affinity:
{{ toYaml .Values.dataCoordinator.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.dataCoordinator.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.dataCoordinator.tolerations }}
tolerations:
{{ toYaml .Values.dataCoordinator.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.dataCoordinator.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.dataCoordinator.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.dataCoordinator.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.dataCoordinator.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.dataCoordinator.securityContext }}
securityContext:
{{ toYaml .Values.dataCoordinator.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 }}

View File

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

View File

@@ -0,0 +1,23 @@
{{- if and .Values.dataNode.enabled .Values.dataNode.hpa.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "milvus.datanode.fullname" . }}-hpa
namespace: {{ .Release.Namespace }}
labels:
component: "datanode"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "milvus.datanode.fullname" . }}
minReplicas: {{ .Values.dataNode.hpa.minReplicas | default 1 }}
maxReplicas: {{ .Values.dataNode.hpa.maxReplicas | default 10 }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.dataNode.hpa.cpuUtilization | default 40 }}
{{- end }}

View File

@@ -0,0 +1,23 @@
{{- if .Values.metrics.enabled }}
{{- if and .Values.dataNode.enabled .Values.cluster.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.datanode.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "datanode"
spec:
type: ClusterIP
clusterIP: None
ports:
- name: metrics
protocol: TCP
port: 9091
targetPort: metrics
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
component: "datanode"
{{- end }}
{{- end }}

View File

@@ -0,0 +1,223 @@
{{- if and .Values.indexCoordinator.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.indexcoord.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "indexcoord"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.indexCoordinator.replicas) 0 }}
replicas: {{ .Values.indexCoordinator.replicas }}
{{- end }}
{{- if .Values.indexCoordinator.activeStandby.enabled}}
{{- with .Values.indexCoordinator.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
strategy:
type: Recreate
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "indexcoord"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "indexcoord"
{{ include "milvus.ud.labels" . | indent 8 }}
annotations:
{{- if .Values.indexCoordinator.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.indexcoord.fullname" . }}
pyroscope.io/port: "9091"
{{- end }}
{{- if .Values.indexCoordinator.annotations }}
{{- toYaml .Values.indexCoordinator.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.indexCoordinator.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.indexCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.indexCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.indexCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: indexcoord
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.indexCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.indexCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.indexCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
{{- if .Values.indexCoordinator.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "indexcoord" ]
{{- else }}
args: [ "milvus", "run", "indexcoord" ]
{{- end }}
env:
{{- if and .Values.streaming .Values.streaming.enabled }}
- name: MILVUS_STREAMING_SERVICE_ENABLED
value: "1"
{{- end }}
{{- if .Values.indexCoordinator.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.indexCoordinator.extraEnv }}
{{- toYaml .Values.indexCoordinator.extraEnv | nindent 8 }}
{{- end }}
ports:
- name: indexcoord
containerPort: 31000
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.indexCoordinator.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.indexCoordinator.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.indexCoordinator.nodeSelector }}
nodeSelector:
{{ toYaml .Values.indexCoordinator.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.indexCoordinator.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.indexCoordinator.affinity }}
affinity:
{{ toYaml .Values.indexCoordinator.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.indexCoordinator.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.indexCoordinator.tolerations }}
tolerations:
{{ toYaml .Values.indexCoordinator.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.indexCoordinator.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.indexCoordinator.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.indexCoordinator.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.indexCoordinator.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.indexCoordinator.securityContext }}
securityContext:
{{ toYaml .Values.indexCoordinator.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 }}

View File

@@ -0,0 +1,236 @@
{{- if and .Values.indexNode.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.indexnode.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "indexnode"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.indexNode.replicas) 0 }}
replicas: {{ .Values.indexNode.replicas }}
{{- end }}
{{- with .Values.indexNode.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "indexnode"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "indexnode"
{{ include "milvus.ud.labels" . | indent 8 }}
annotations:
{{- if .Values.indexNode.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.indexnode.fullname" . }}
pyroscope.io/port: "9091"
{{- end }}
{{- if .Values.indexNode.annotations }}
{{- toYaml .Values.indexNode.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.indexNode.runtimeClassName }}
runtimeClassName: {{ .Values.indexNode.runtimeClassName }}
{{- end }}
{{- if .Values.image.all.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.all.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
initContainers:
{{- if .Values.indexNode.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.indexNode.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.indexNode.containerSecurityContext }}
securityContext:
{{- toYaml .Values.indexNode.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: indexnode
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.indexNode.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.indexNode.containerSecurityContext }}
securityContext:
{{- toYaml .Values.indexNode.containerSecurityContext | nindent 12 }}
{{ end }}
{{- if .Values.indexNode.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "indexnode" ]
{{- else }}
args: [ "milvus", "run", "indexnode" ]
{{- end }}
env:
{{- if and .Values.streaming .Values.streaming.enabled }}
- name: MILVUS_STREAMING_SERVICE_ENABLED
value: "1"
{{- end }}
{{- if .Values.indexNode.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.indexNode.disk.size.enabled }}
- name: LOCAL_STORAGE_SIZE
valueFrom:
resourceFieldRef:
divisor: 1Gi
resource: limits.ephemeral-storage
{{- end }}
{{- if .Values.indexNode.extraEnv }}
{{- toYaml .Values.indexNode.extraEnv | nindent 8 }}
{{- end }}
ports:
- name: indexnode
containerPort: 21121
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.indexNode.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.indexNode.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.indexNode.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.indexNode.nodeSelector }}
nodeSelector:
{{ toYaml .Values.indexNode.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.indexNode.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.indexNode.affinity }}
affinity:
{{ toYaml .Values.indexNode.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.indexNode.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.indexNode.tolerations }}
tolerations:
{{ toYaml .Values.indexNode.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.indexNode.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.indexNode.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.indexNode.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.indexNode.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.indexNode.securityContext }}
securityContext:
{{ toYaml .Values.indexNode.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.indexNode.disk.enabled }}
- name: disk
emptyDir: {}
{{- end }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 6 }}
{{- end}}
{{- end }}

View File

@@ -0,0 +1,100 @@
{{- if and .Values.ingress.enabled }}
{{- $serviceName := include "milvus.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "milvus.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.ingress.labels }}
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
defaultBackend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- if .Values.ingress.rules }}
rules:
{{- range $rule := .Values.ingress.rules }}
- host: {{ $rule.host }}
http:
paths:
- path: {{ $rule.path }}
pathType: {{ $rule.pathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- end }}
{{- else }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "milvus.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.ingress.labels }}
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- if .Values.ingress.rules }}
rules:
{{- range $rule := .Values.ingress.rules }}
- host: {{ $rule.host }}
http:
paths:
- path: {{ $rule.path }}
pathType: {{ $rule.pathType }}
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end }}

View 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 }}

View File

@@ -0,0 +1,30 @@
{{- if and .Values.mixCoordinator.enabled .Values.cluster.enabled .Values.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.mixcoord.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.mixCoordinator.service.labels }}
{{ toYaml .Values.mixCoordinator.service.labels | indent 4 }}
{{- end }}
component: "mixcoord"
{{- with .Values.mixCoordinator.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
type: ClusterIP
{{- if .Values.mixCoordinator.service.clusterIP }}
clusterIP: {{ .Values.mixCoordinator.service.clusterIP }}
{{- end }}
ports:
- name: metrics
protocol: TCP
port: 9091
targetPort: metrics
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
component: "mixcoord"
{{- end }}

View File

@@ -0,0 +1,221 @@
{{- 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 }}

View File

@@ -0,0 +1,23 @@
{{- if and .Values.proxy.enabled .Values.proxy.hpa.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "milvus.proxy.fullname" . }}-hpa
namespace: {{ .Release.Namespace }}
labels:
component: "proxy"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "milvus.proxy.fullname" . }}
minReplicas: {{ .Values.proxy.hpa.minReplicas | default 1 }}
maxReplicas: {{ .Values.proxy.hpa.maxReplicas | default 10 }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.proxy.hpa.cpuUtilization | default 40 }}
{{- end }}

View File

@@ -0,0 +1,17 @@
{{- if and (.Values.proxy.tls) (.Values.proxy.tls.enabled) }}
{{- if and (.Values.proxy.tls.crt) (.Values.proxy.tls.key) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.proxy.tls.secretName }}
namespace: {{ .Release.Namespace }}
data:
tls.crt: {{ .Values.proxy.tls.crt }}
tls.key: {{ .Values.proxy.tls.key }}
type: kubernetes.io/tls
{{- end }}
{{- end -}}

View File

@@ -0,0 +1,56 @@
{{- if .Values.pulsar.enabled }}
{{- if .Values.pulsar.broker.podMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ template "milvus.pulsar.fullname" . }}-broker
namespace: {{ .Release.Namespace }}
labels:
app: pulsar
cluster: {{ template "milvus.pulsar.fullname" .}}
component: broker
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
podMetricsEndpoints:
- interval: 30s
path: /metrics
port: http
scheme: http
scrapeTimeout: 30s
selector:
matchLabels:
app: pulsar
cluster: {{ template "milvus.pulsar.fullname" .}}
component: broker
{{- end }}
{{- if .Values.pulsar.proxy.podMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ template "milvus.pulsar.fullname" . }}-proxy
namespace: {{ .Release.Namespace }}
labels:
app: pulsar
cluster: {{ template "milvus.pulsar.fullname" .}}
component: proxy
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
podMetricsEndpoints:
- interval: 30s
path: /metrics
port: http
scheme: http
scrapeTimeout: 30s
selector:
matchLabels:
app: pulsar
cluster: {{ template "milvus.pulsar.fullname" .}}
component: proxy
{{- end }}
{{- end }}

View File

@@ -0,0 +1,60 @@
{{- if not .Values.cluster.enabled }}
{{- $pvc := .Values.standalone.persistence.persistentVolumeClaim -}}
{{- if and .Values.standalone.persistence.enabled (not $pvc.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s" (include "milvus.fullname" . | trunc 58)}}
namespace: {{ .Release.Namespace }}
{{- with .Values.standalone.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
{{ include "milvus.labels" . | indent 4 }}
spec:
accessModes:
- {{ $pvc.accessModes | quote }}
{{- if $pvc.storageClass }}
{{- if eq "-" $pvc.storageClass }}
storageClassName: ""
{{- else }}
storageClassName: {{ $pvc.storageClass }}
{{- end }}
{{- end }}
resources:
requests:
storage: {{ $pvc.size }}
{{- end }}
{{- end }}
{{- $pvc := .Values.log.persistence.persistentVolumeClaim -}}
{{- if and .Values.log.persistence.enabled (not $pvc.existingClaim)}}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ printf "%s-logs" (include "milvus.fullname" . | trunc 58)}}
namespace: {{ .Release.Namespace }}
{{- with .Values.log.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
{{ include "milvus.labels" . | indent 4 }}
spec:
accessModes:
- {{ $pvc.accessModes | quote }}
{{- if $pvc.storageClass }}
{{- if eq "-" $pvc.storageClass }}
storageClassName: ""
{{- else }}
storageClassName: {{ $pvc.storageClass }}
{{- end }}
{{- end }}
resources:
requests:
storage: {{ $pvc.size }}
{{- end }}

View File

@@ -0,0 +1,223 @@
{{- 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 }}
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 }}

View File

@@ -0,0 +1,232 @@
{{- if and .Values.queryNode.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.querynode.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "querynode"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.queryNode.replicas) 0 }}
replicas: {{ .Values.queryNode.replicas }}
{{- end }}
{{- with .Values.queryNode.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "querynode"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "querynode"
{{ include "milvus.ud.labels" . | indent 8 }}
annotations:
{{- if .Values.queryNode.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.querynode.fullname" . }}
pyroscope.io/port: "9091"
{{- end }}
{{- if .Values.queryNode.annotations }}
{{- toYaml .Values.queryNode.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.queryNode.runtimeClassName }}
runtimeClassName: {{ .Values.queryNode.runtimeClassName }}
{{- end }}
{{- if .Values.image.all.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.all.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
initContainers:
{{- if .Values.queryNode.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.queryNode.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.queryNode.containerSecurityContext }}
securityContext:
{{- toYaml .Values.queryNode.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: querynode
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.queryNode.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.queryNode.containerSecurityContext }}
securityContext:
{{- toYaml .Values.queryNode.containerSecurityContext | nindent 12 }}
{{ end }}
{{- if .Values.queryNode.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "querynode" ]
{{- else }}
args: [ "milvus", "run", "querynode" ]
{{- end }}
env:
{{- if .Values.queryNode.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.queryNode.disk.size.enabled }}
- name: LOCAL_STORAGE_SIZE
valueFrom:
resourceFieldRef:
divisor: 1Gi
resource: limits.ephemeral-storage
{{- end }}
{{- if .Values.queryNode.extraEnv }}
{{- toYaml .Values.queryNode.extraEnv | nindent 8 }}
{{- end }}
ports:
- name: querynode
containerPort: 21123
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.queryNode.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.queryNode.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.queryNode.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.queryNode.nodeSelector }}
nodeSelector:
{{ toYaml .Values.queryNode.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.queryNode.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.queryNode.affinity }}
affinity:
{{ toYaml .Values.queryNode.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.queryNode.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.queryNode.tolerations }}
tolerations:
{{ toYaml .Values.queryNode.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.queryNode.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.queryNode.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.queryNode.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.queryNode.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.queryNode.securityContext }}
securityContext:
{{ toYaml .Values.queryNode.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.queryNode.disk.enabled }}
- name: disk
emptyDir: {}
{{- end }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 6 }}
{{- end}}
{{- end }}

View File

@@ -0,0 +1,29 @@
{{- if and .Values.queryNode.enabled .Values.queryNode.hpa.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "milvus.querynode.fullname" . }}-hpa
namespace: {{ .Release.Namespace }}
labels:
component: "querynode"
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "milvus.querynode.fullname" . }}
minReplicas: {{ .Values.queryNode.hpa.minReplicas | default 1 }}
maxReplicas: {{ .Values.queryNode.hpa.maxReplicas | default 10 }}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.queryNode.hpa.cpuUtilization | default 40 }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.queryNode.hpa.memoryUtilization | default 40 }}
{{- end }}

View File

@@ -0,0 +1,23 @@
{{- if .Values.metrics.enabled }}
{{- if and .Values.queryNode.enabled .Values.cluster.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.querynode.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "querynode"
spec:
type: ClusterIP
clusterIP: None
ports:
- name: metrics
protocol: TCP
port: 9091
targetPort: metrics
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
component: "querynode"
{{- end }}
{{- end }}

View File

@@ -0,0 +1,223 @@
{{- if and .Values.rootCoordinator.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.rootcoord.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "rootcoord"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.rootCoordinator.replicas) 0 }}
replicas: {{ .Values.rootCoordinator.replicas }}
{{- end }}
{{- if .Values.rootCoordinator.activeStandby.enabled}}
{{- with .Values.rootCoordinator.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
strategy:
type: Recreate
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "rootcoord"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "rootcoord"
{{ include "milvus.ud.labels" . | indent 8 }}
annotations:
{{- if .Values.rootCoordinator.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.rootcoord.fullname" . }}
pyroscope.io/port: "9091"
{{- end }}
{{- if .Values.rootCoordinator.annotations }}
{{- toYaml .Values.rootCoordinator.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.rootCoordinator.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.rootCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.rootCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.rootCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: rootcoord
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.rootCoordinator.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.rootCoordinator.containerSecurityContext }}
securityContext:
{{- toYaml .Values.rootCoordinator.containerSecurityContext | nindent 12 }}
{{ end }}
{{- if .Values.rootCoordinator.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "rootcoord" ]
{{- else }}
args: [ "milvus", "run", "rootcoord" ]
{{- end }}
env:
{{- if and .Values.streaming .Values.streaming.enabled }}
- name: MILVUS_STREAMING_SERVICE_ENABLED
value: "1"
{{- end }}
{{- if .Values.rootCoordinator.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.rootCoordinator.extraEnv }}
{{- toYaml .Values.rootCoordinator.extraEnv | nindent 8 }}
{{- end }}
ports:
- name: rootcoord
containerPort: 53100
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.rootCoordinator.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.rootCoordinator.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.rootCoordinator.nodeSelector }}
nodeSelector:
{{ toYaml .Values.rootCoordinator.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.rootCoordinator.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.rootCoordinator.affinity }}
affinity:
{{ toYaml .Values.rootCoordinator.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.rootCoordinator.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.rootCoordinator.tolerations }}
tolerations:
{{ toYaml .Values.rootCoordinator.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.rootCoordinator.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.rootCoordinator.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.rootCoordinator.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.rootCoordinator.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.rootCoordinator.securityContext }}
securityContext:
{{ toYaml .Values.rootCoordinator.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 }}

View File

@@ -0,0 +1,122 @@
{{- if or .Values.proxy.enabled (not .Values.cluster.enabled) }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
{{- if not .Values.cluster.enabled }}
component: "standalone"
{{- else if and .Values.proxy.enabled .Values.cluster.enabled }}
component: "proxy"
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
type: ClusterIP
{{- if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- else if eq .Values.service.type "LoadBalancer" }}
type: LoadBalancer
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.service.type }}
{{- end }}
ports:
- name: {{ .Values.service.portName }}
port: {{ .Values.service.port }}
protocol: TCP
targetPort: milvus
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{- end }}
{{- if .Values.metrics.enabled }}
- name: metrics
protocol: TCP
port: 9091
targetPort: metrics
{{- end }}
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
{{- if not .Values.cluster.enabled }}
component: "standalone"
{{- else if and .Values.proxy.enabled .Values.cluster.enabled }}
component: "proxy"
{{- end }}
{{- end }}
---
{{- if or .Values.proxy.enabled (not .Values.cluster.enabled) }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.standalone.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
{{- if not .Values.cluster.enabled }}
component: "standalone"
{{- else if and .Values.proxy.enabled .Values.cluster.enabled }}
component: "proxy"
{{- end }}
{{- with .Values.service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
type: ClusterIP
{{- if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}
{{- else if eq .Values.service.type "LoadBalancer" }}
type: LoadBalancer
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
{{- end -}}
{{- else }}
type: {{ .Values.service.type }}
{{- end }}
ports:
- name: {{ .Values.service.portName }}
port: {{ .Values.service.port }}
protocol: TCP
targetPort: milvus
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
nodePort: {{.Values.service.nodePort}}
{{- end }}
{{- if .Values.metrics.enabled }}
- name: metrics
protocol: TCP
port: 9091
targetPort: metrics
{{- end }}
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
{{- if not .Values.cluster.enabled }}
component: "standalone"
{{- else if and .Values.proxy.enabled .Values.cluster.enabled }}
component: "proxy"
{{- end }}
{{- end }}

View File

@@ -0,0 +1,16 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "milvus.serviceAccount" . }}
namespace: {{ .Release.Namespace }}
{{- if .Values.serviceAccount.annotations }}
annotations:
{{ toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- with .Values.serviceAccount.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,65 @@
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
{{- if not .Values.cluster.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "milvus.standalone.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
component: "standalone"
spec:
endpoints:
- honorLabels: true
interval: {{ .Values.metrics.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
path: /metrics
port: metrics
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: standalone
targetLabels:
- app.kubernetes.io/name
- app.kubernetes.io/instance
- component
{{- end }}
---
{{- if .Values.cluster.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "milvus.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
{{- if .Values.metrics.serviceMonitor.additionalLabels }}
{{ toYaml .Values.metrics.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
spec:
endpoints:
- honorLabels: true
interval: {{ .Values.metrics.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
path: /metrics
port: metrics
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
targetLabels:
- app.kubernetes.io/name
- app.kubernetes.io/instance
- component
{{- end }}
{{- end }}

View 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 }}

View File

@@ -0,0 +1,218 @@
{{- if and .Values.streaming .Values.streaming.enabled .Values.cluster.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "milvus.streamingnode.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "streamingnode"
{{ include "milvus.ud.labels" . | indent 4 }}
annotations:
{{ include "milvus.ud.annotations" . | indent 4 }}
spec:
{{- if ge (int .Values.streamingNode.replicas) 0 }}
replicas: {{ .Values.streamingNode.replicas }}
{{- end }}
{{- with .Values.streamingNode.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{ include "milvus.matchLabels" . | indent 6 }}
component: "streamingnode"
template:
metadata:
labels:
{{ include "milvus.matchLabels" . | indent 8 }}
component: "streamingnode"
{{ include "milvus.ud.labels" . | indent 8 }}
annotations:
{{- if .Values.streamingNode.profiling.enabled }}
pyroscope.io/scrape: "true"
pyroscope.io/application-name: {{ template "milvus.streamingnode.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.streamingNode.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.streamingNode.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.streamingNode.containerSecurityContext }}
securityContext:
{{- toYaml .Values.streamingNode.containerSecurityContext | nindent 12 }}
{{ end }}
volumeMounts:
- mountPath: /milvus/tools
name: tools
{{- end }}
containers:
- name: streamingnode
image: "{{ .Values.image.all.repository }}:{{ .Values.image.all.tag }}"
imagePullPolicy: {{ .Values.image.all.pullPolicy }}
{{ if and (.Values.containerSecurityContext) (not .Values.streamingNode.containerSecurityContext) }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
{{ end }}
{{ if .Values.streamingNode.containerSecurityContext }}
securityContext:
{{- toYaml .Values.streamingNode.containerSecurityContext | nindent 12 }}
{{ end }}
{{- if .Values.streamingNode.heaptrack.enabled }}
args: [ "/milvus/tools/heaptrack/bin/heaptrack", "milvus", "run", "streamingnode" ]
{{- else }}
args: [ "milvus", "run", "streamingnode" ]
{{- end }}
env:
{{- if .Values.streamingNode.heaptrack.enabled }}
- name: LD_LIBRARY_PATH
value: /milvus/tools/heaptrack/lib:/milvus/lib:/usr/lib
{{- end }}
{{- if .Values.streamingNode.extraEnv }}
{{- toYaml .Values.streamingNode.extraEnv | nindent 8 }}
{{- end }}
ports:
- name: streamingnode
containerPort: 22222
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.streamingNode.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.woodpecker.enabled }}
- mountPath: /var/lib/milvus
name: woodpecker
{{- end }}
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 8 }}
{{- end}}
{{- if and (.Values.nodeSelector) (not .Values.streamingNode.nodeSelector) }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.streamingNode.nodeSelector }}
nodeSelector:
{{ toYaml .Values.streamingNode.nodeSelector | indent 8 }}
{{- end }}
{{- if and (.Values.affinity) (not .Values.streamingNode.affinity) }}
affinity:
{{ toYaml .Values.affinity | indent 8 }}
{{- end }}
{{- if .Values.streamingNode.affinity }}
affinity:
{{ toYaml .Values.streamingNode.affinity | indent 8 }}
{{- end }}
{{- if and (.Values.tolerations) (not .Values.streamingNode.tolerations) }}
tolerations:
{{ toYaml .Values.tolerations | indent 8 }}
{{- end }}
{{- if .Values.streamingNode.tolerations }}
tolerations:
{{ toYaml .Values.streamingNode.tolerations | indent 8 }}
{{- end }}
{{- if and (.Values.topologySpreadConstraints) (not .Values.streamingNode.topologySpreadConstraints) }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if .Values.streamingNode.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.streamingNode.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- if and (.Values.securityContext) (not .Values.streamingNode.securityContext) }}
securityContext:
{{ toYaml .Values.securityContext | indent 8 }}
{{- end }}
{{- if .Values.streamingNode.securityContext }}
securityContext:
{{ toYaml .Values.streamingNode.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.woodpecker.enabled }}
- name: woodpecker
emptyDir: {}
{{- end }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 6 }}
{{- end}}
{{- end }}

View File

@@ -0,0 +1,23 @@
{{- if .Values.metrics.enabled }}
{{- if and .Values.streaming .Values.streaming.enabled .Values.cluster.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "milvus.streamingnode.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "milvus.labels" . | indent 4 }}
component: "streamingnode"
spec:
type: ClusterIP
clusterIP: None
ports:
- name: metrics
protocol: TCP
port: 9091
targetPort: metrics
selector:
{{ include "milvus.matchLabels" . | indent 4 }}
component: "streamingnode"
{{- end }}
{{- end }}