Files
iAOP/deploy/k8s/helm/iaop/templates/deployment.yaml
T

86 lines
2.8 KiB
YAML
Raw Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "iaop.fullname" . }}
labels:
{{- include "iaop.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: {{ .Values.rollingUpdate.maxUnavailable }}
maxSurge: {{ .Values.rollingUpdate.maxSurge }}
selector:
matchLabels:
{{- include "iaop.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "iaop.selectorLabels" . | nindent 8 }}
iaop.ai/inference-backend: {{ .Values.inference.backend }}
spec:
{{- if eq .Values.inference.backend "gpu" }}
# NVIDIA GPU(5090)节点选择:推理节点打标 nvidia.com/gpu=true
nodeSelector:
nvidia.com/gpu: "true"
{{- else }}
# 华为昇腾 NPU 节点选择:推理节点打标 ascend.com/npu=true
nodeSelector:
ascend.com/npu: "true"
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{- toYaml .Values.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.image.serviceAccountName }}
serviceAccountName: {{ .Values.image.serviceAccountName }}
{{- end }}
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end }}
containers:
- name: inference
image: "{{ include "iaop.image" . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
env:
- name: IAOP_BACKEND_CONFIG
value: /etc/iaop/backends.yaml
volumeMounts:
- name: backend-config
mountPath: /etc/iaop
readOnly: true
{{- if .Values.storage.enabled }}
- name: model-store
mountPath: /models
{{- end }}
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: backend-config
configMap:
name: {{ include "iaop.fullname" . }}-backend
{{- if .Values.storage.enabled }}
- name: model-store
persistentVolumeClaim:
claimName: {{ include "iaop.fullname" . }}-models
{{- end }}