Files
charts/bitnami/milvus/templates/data-coordinator/deployment.yaml
Carlos Rodríguez Hernández ba40e46ec6 [bitnami/milvus] Bump kafka major version and update license header (#17538)
Signed-off-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
2023-07-10 09:27:23 +02:00

209 lines
11 KiB
YAML

{{- /*
Copyright VMware, Inc.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{- if .Values.dataCoord.enabled }}
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "milvus.data-coordinator.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/part-of: milvus
app.kubernetes.io/component: data-coordinator
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if not .Values.dataCoord.autoscaling.hpa.enabled }}
replicas: {{ .Values.dataCoord.replicaCount }}
{{- end }}
{{- if .Values.dataCoord.updateStrategy }}
strategy: {{- toYaml .Values.dataCoord.updateStrategy | nindent 4 }}
{{- end }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/part-of: milvus
app.kubernetes.io/component: data-coordinator
template:
metadata:
annotations:
checksum/common-config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/common-config-extra: {{ include (print $.Template.BasePath "/extra-configmap.yaml") . | sha256sum }}
checksum/config-extra: {{ include (print $.Template.BasePath "/data-coordinator/extra-configmap.yaml") . | sha256sum }}
{{- if .Values.dataCoord.podAnnotations }}
{{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/part-of: milvus
app.kubernetes.io/component: data-coordinator
{{- if .Values.dataCoord.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.podLabels "context" $) | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "milvus.data-coordinator.serviceAccountName" . }}
{{- include "milvus.imagePullSecrets" . | nindent 6 }}
{{- if .Values.dataCoord.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.dataCoord.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.dataCoord.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.dataCoord.podAffinityPreset "component" "data-coordinator" "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.dataCoord.podAntiAffinityPreset "component" "data-coordinator" "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.dataCoord.nodeAffinityPreset.type "key" .Values.dataCoord.nodeAffinityPreset.key "values" .Values.dataCoord.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.dataCoord.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.dataCoord.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.dataCoord.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.tolerations "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.dataCoord.runtimeClassName }}
runtimeClassName: {{ .Values.dataCoord.runtimeClassName | quote }}
{{- end }}
{{- if .Values.dataCoord.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.dataCoord.priorityClassName }}
priorityClassName: {{ .Values.dataCoord.priorityClassName | quote }}
{{- end }}
{{- if .Values.dataCoord.schedulerName }}
schedulerName: {{ .Values.dataCoord.schedulerName }}
{{- end }}
{{- if .Values.dataCoord.podSecurityContext.enabled }}
securityContext: {{- omit .Values.dataCoord.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
initContainers:
{{- if .Values.dataCoord.enableDefaultInitContainers }}
{{- include "milvus.waitForETCDInitContainer" . | nindent 8 }}
{{- include "milvus.waitForKafkaInitContainer" . | nindent 8 }}
{{- include "milvus.waitForS3InitContainer" . | nindent 8 }}
{{- include "milvus.prepareMilvusInitContainer" (dict "component" "dataCoord" "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.dataCoord.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: milvus
image: {{ template "milvus.image" . }}
imagePullPolicy: {{ .Values.milvus.image.pullPolicy }}
{{- if .Values.dataCoord.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.dataCoord.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
{{- else if .Values.dataCoord.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.command "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else if .Values.dataCoord.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.args "context" $) | nindent 12 }}
{{- else }}
args:
- run
- datacoord
{{- end }}
env:
- name: METRICS_PORT
value: {{ .Values.dataCoord.containerPorts.metrics | quote }}
{{- if .Values.dataCoord.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
{{- if .Values.dataCoord.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.dataCoord.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.dataCoord.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.dataCoord.extraEnvVarsSecret "context" $) }}
{{- end }}
ports:
- containerPort: {{ .Values.dataCoord.containerPorts.grpc }}
name: grpc
- containerPort: {{ .Values.dataCoord.containerPorts.metrics }}
name: http-metrics
{{- if .Values.dataCoord.resources }}
resources: {{- toYaml .Values.dataCoord.resources | nindent 12 }}
{{- end }}
{{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.dataCoord.customLivenessProbe }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.customLivenessProbe "context" $) | nindent 12 }}
{{- else if .Values.dataCoord.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.dataCoord.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /healthz
port: http-metrics
{{- end }}
{{- if .Values.dataCoord.customReadinessProbe }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.customReadinessProbe "context" $) | nindent 12 }}
{{- else if .Values.dataCoord.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.dataCoord.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet:
path: /healthz
port: http-metrics
{{- end }}
{{- if .Values.dataCoord.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.customStartupProbe "context" $) | nindent 12 }}
{{- else if .Values.dataCoord.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.dataCoord.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: http-metrics
{{- end }}
{{- end }}
{{- if .Values.dataCoord.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
volumeMounts:
- name: rendered-config
mountPath: /opt/bitnami/milvus/configs
- name: tmp
mountPath: /tmp
- name: tmp-milvus
mountPath: /opt/bitnami/milvus/tmp
# We are using a s3 backend, so this data dir is temporary
- name: tmp-data-milvus
mountPath: /bitnami/milvus/data
{{- if .Values.dataCoord.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.dataCoord.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.dataCoord.sidecars "context" $) | nindent 8 }}
{{- end }}
volumes:
- name: tmp-data-milvus
emptyDir: {}
- name: tmp-milvus
emptyDir: {}
- name: tmp
emptyDir: {}
- name: config-common
configMap:
name: {{ template "milvus.configmapName" . }}
{{- if or .Values.milvus.extraConfig .Values.milvus.extraConfigExistingConfigMap }}
- name: extra-config-common
configMap:
name: {{ template "milvus.extraConfigmapName" . }}
{{- end }}
- name: component-config-default
configMap:
name: {{ template "milvus.data-coordinator.configmapName" . }}
{{- if or .Values.dataCoord.extraConfig .Values.dataCoord.extraConfigExistingConfigMap }}
- name: component-extra-config
configMap:
name: {{ template "milvus.data-coordinator.extraConfigmapName" . }}
{{- end }}
- name: rendered-config
emptyDir: {}
{{- if .Values.dataCoord.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.dataCoord.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}