-
Notifications
You must be signed in to change notification settings - Fork 301
Expand file tree
/
Copy pathepp-deployment.yaml
More file actions
122 lines (121 loc) · 4.62 KB
/
Copy pathepp-deployment.yaml
File metadata and controls
122 lines (121 loc) · 4.62 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gateway-api-inference-extension.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gateway-api-inference-extension.labels" . | nindent 4 }}
spec:
{{- if .Values.inferenceExtension.enableLeaderElection }}
replicas: 3
{{- else }}
replicas: 1
{{- end }}
strategy:
# The current recommended EPP deployment pattern is to have a single active replica. This ensures
# optimal performance of the stateful operations such prefix cache aware scorer.
# The Recreate strategy the old replica is killed immediately, and allow the new replica(s) to
# quickly take over. This is particularly important in the high availability set up with leader
# election, as the rolling update strategy would prevent the old leader being killed because
# otherwise the maxUnavailable would be 100%.
type: Recreate
selector:
matchLabels:
{{- include "gateway-api-inference-extension.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "gateway-api-inference-extension.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "gateway-api-inference-extension.name" . }}
# Conservatively, this timeout should mirror the longest grace period of the pods within the pool
terminationGracePeriodSeconds: 130
containers:
- name: epp
image: {{ .Values.inferenceExtension.image.hub }}/{{ .Values.inferenceExtension.image.name }}:{{ .Values.inferenceExtension.image.tag }}
imagePullPolicy: {{ .Values.inferenceExtension.image.pullPolicy | default "Always" }}
args:
- --pool-name
- {{ .Release.Name }}
{{- if ne .Values.inferencePool.apiVersion "inference.networking.k8s.io" }}
- --pool-group
- "{{ (split "/" .Values.inferencePool.apiVersion)._0 }}"
{{- end }}
- --zap-encoder
- "json"
- --zap-log-level
- "info"
- --config-file
- "/config/{{ .Values.inferenceExtension.pluginsConfigFile }}"
{{- if eq (.Values.inferencePool.modelServerType | default "vllm") "triton-tensorrt-llm" }}
- --total-queued-requests-metric
- "nv_trt_llm_request_metrics{request_type=waiting}"
- --kv-cache-usage-percentage-metric
- "nv_trt_llm_kv_cache_block_metrics{kv_cache_block_type=fraction}"
- --lora-info-metric
- "" # Set an empty metric to disable LoRA metric scraping as they are not supported by Triton yet.
{{- end }}
{{- if .Values.inferenceExtension.enableLeaderElection }}
- --ha-enable-leader-election
{{- end }}
# Pass additional flags via the inferenceExtension.flags field in values.yaml.
{{- range .Values.inferenceExtension.flags }}
- "--{{ .name }}"
- "{{ .value }}"
{{- end }}
ports:
- name: grpc
containerPort: 9002
- name: grpc-health
containerPort: 9003
- name: metrics
containerPort: 9090
{{- if .Values.inferenceExtension.extraContainerPorts }}
{{- toYaml .Values.inferenceExtension.extraContainerPorts | nindent 8 }}
{{- end }}
livenessProbe:
{{- if .Values.inferenceExtension.enableLeaderElection }}
grpc:
port: 9003
service: liveness
{{- else }}
grpc:
port: 9003
service: inference-extension
{{- end }}
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
{{- if .Values.inferenceExtension.enableLeaderElection }}
grpc:
port: 9003
service: readiness
{{- else }}
grpc:
port: 9003
service: inference-extension
{{- end }}
periodSeconds: 2
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.inferenceExtension.env }}
{{- toYaml .Values.inferenceExtension.env | nindent 8 }}
{{- end }}
volumeMounts:
- name: plugins-config-volume
mountPath: "/config"
volumes:
- name: plugins-config-volume
configMap:
name: {{ include "gateway-api-inference-extension.name" . }}
{{- if .Values.inferenceExtension.affinity }}
affinity:
{{- toYaml .Values.inferenceExtension.affinity | nindent 8 }}
{{- end }}
{{- if .Values.inferenceExtension.tolerations }}
tolerations:
{{- toYaml .Values.inferenceExtension.tolerations | nindent 8 }}
{{- end }}