demo-chart/templates/deployment.yaml

67 lines
2.1 KiB
YAML
Raw Normal View History

2023-03-29 01:29:07 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
2023-04-19 02:35:56 +00:00
name: {{ include "ailab-demo.fullname" . }}
2023-03-29 01:29:07 +00:00
labels:
2023-04-19 02:35:56 +00:00
{{- include "ailab-demo.labels" . | nindent 4 }}
2023-03-29 01:29:07 +00:00
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
2023-04-19 02:35:56 +00:00
{{- include "ailab-demo.selectorLabels" . | nindent 6 }}
2023-03-29 01:29:07 +00:00
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
2023-04-19 02:35:56 +00:00
{{- include "ailab-demo.selectorLabels" . | nindent 8 }}
2023-03-29 01:29:07 +00:00
spec:
2023-04-19 13:14:35 +00:00
affinity:
{{- include "ailab-demo.GPUNodeAffinity" . | nindent 8 }}
2023-03-29 01:29:07 +00:00
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
2023-04-19 02:35:56 +00:00
serviceAccountName: {{ include "ailab-demo.serviceAccountName" . }}
2023-03-29 01:29:07 +00:00
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
2023-04-19 13:14:35 +00:00
{{- if .Values.livenessProbe }}
2023-03-29 01:29:07 +00:00
livenessProbe:
2023-04-19 02:23:15 +00:00
{{- toYaml .Values.livenessProbe | nindent 12 }}
2023-04-19 13:14:35 +00:00
{{ end }}
{{- if .Values.readinessProbe }}
2023-03-29 01:29:07 +00:00
readinessProbe:
2023-04-19 02:23:15 +00:00
{{- toYaml .Values.readinessProbe | nindent 12 }}
2023-04-19 13:14:35 +00:00
{{ end}}
{{- if .Values.resources }}
2023-03-29 01:29:07 +00:00
resources:
{{- toYaml .Values.resources | nindent 12 }}
2023-04-19 13:14:35 +00:00
{{- end }}
2023-04-19 02:35:56 +00:00
volumeMounts:
- mountPath: /mnt/atpdata/huggingface
name: huggingface
volumes:
- name: huggingface
hostPath:
path: {{ .Values.huggingface.path }}
2023-03-29 01:29:07 +00:00
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}