-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathdeployment.yaml
122 lines (121 loc) · 4.16 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "chatqna.fullname" . }}
labels:
{{- include "chatqna.labels" . | nindent 4 }}
app: {{ include "chatqna.fullname" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "chatqna.selectorLabels" . | nindent 6 }}
app: {{ include "chatqna.fullname" . }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "chatqna.selectorLabels" . | nindent 8 }}
app: {{ include "chatqna.fullname" . }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "chatqna.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Release.Name }}
env:
- name: LLM_SERVER_HOST_IP
{{- if .Values.vllm.enabled }}
value: {{ .Release.Name }}-vllm
{{- else }}
value: {{ .Release.Name }}-tgi
{{- end }}
- name: LLM_SERVER_PORT
value: "80"
- name: LLM_MODEL
{{- if .Values.vllm.enabled }}
value: {{ .Values.vllm.LLM_MODEL_ID | quote }}
{{- else }}
value: {{ .Values.tgi.LLM_MODEL_ID | quote }}
{{- end }}
- name: RERANK_SERVER_HOST_IP
value: {{ .Release.Name }}-teirerank
- name: RERANK_SERVER_PORT
value: "80"
- name: RETRIEVER_SERVICE_HOST_IP
value: {{ .Release.Name }}-retriever-usvc
- name: RETRIEVER_SERVICE_PORT
value: "7000"
- name: EMBEDDING_SERVER_HOST_IP
value: {{ .Release.Name }}-tei
- name: EMBEDDING_SERVER_PORT
value: "80"
- name: GUARDRAIL_SERVICE_HOST_IP
value: {{ .Release.Name }}-guardrails-usvc
- name: GUARDRAIL_SERVICE_PORT
value: "9090"
- name: LLM_SERVICE_HOST_IP
value: {{ .Release.Name }}-llm-uservice
- name: LLM_SERVICE_PORT
value: "9000"
- name: RERANK_SERVICE_HOST_IP
value: {{ .Release.Name }}-reranking-usvc
- name: RERANK_SERVICE_PORT
value: "8000"
- name: EMBEDDING_SERVICE_HOST_IP
value: {{ .Release.Name }}-embedding-usvc
- name: EMBEDDING_SERVICE_PORT
value: "6000"
{{- if .Values.LOGFLAG }}
- name: LOGFLAG
value: {{ .Values.LOGFLAG | quote }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
{{- if .Values.image.pullPolicy }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- end }}
volumeMounts:
- mountPath: /tmp
name: tmp
ports:
- name: chatqna
containerPort: {{ .Values.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: tmp
emptyDir: {}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.evenly_distributed }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
{{- include "chatqna.selectorLabels" . | nindent 14 }}
app: {{ include "chatqna.fullname" . }}
{{- end }}