Skip to content

Commit 81deb19

Browse files
authored
helm support for sidecar injection in EPP (#1821)
* draft * draft * workable version * added docs * fixed format * move epp-envoy to a standalone file * make standalone a provider * removed unused change * remove unused change * syntax fix * workable version * remove unused yaml * added more customized info and removed example * fixed typo * fixed default image pull policy
1 parent 5b32ebc commit 81deb19

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

config/charts/inferencepool/templates/epp-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ data:
2424
{{- .Values.inferenceExtension.pluginsCustomConfig | toYaml | nindent 2 }}
2525
{{- end }}
2626

27+
---
28+
{{- if .Values.inferenceExtension.sidecar.enabled }}
29+
apiVersion: v1
30+
kind: ConfigMap
31+
metadata:
32+
name: {{ .Values.inferenceExtension.sidecar.configMap.name }}
33+
namespace: {{ .Release.Namespace }}
34+
data:
35+
{{- .Values.inferenceExtension.sidecar.configMap.data | toYaml | nindent 2 }}
36+
{{- end }}

config/charts/inferencepool/templates/epp-deployment.yaml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,48 @@ spec:
2727
# Conservatively, this timeout should mirror the longest grace period of the pods within the pool
2828
terminationGracePeriodSeconds: 130
2929
containers:
30+
{{- if .Values.inferenceExtension.sidecar.enabled }}
31+
- name: {{ .Values.inferenceExtension.sidecar.name }}
32+
image: {{ .Values.inferenceExtension.sidecar.image }}
33+
imagePullPolicy: {{ .Values.inferenceExtension.sidecar.image.pullPolicy | default "IfNotPresent" }}
34+
{{- with .Values.inferenceExtension.sidecar.command }}
35+
command:
36+
- {{ . | quote }}
37+
{{- end }}
38+
{{- with .Values.inferenceExtension.sidecar.args }}
39+
args:
40+
{{- range . }}
41+
- {{ tpl . $ | quote }}
42+
{{- end }}
43+
{{- end }}
44+
{{- with .Values.inferenceExtension.sidecar.env }}
45+
env:
46+
{{- toYaml . | nindent 10 }}
47+
{{- end }}
48+
{{- with .Values.inferenceExtension.sidecar.ports }}
49+
ports:
50+
{{- toYaml . | nindent 10 }}
51+
{{- end }}
52+
{{- with .Values.inferenceExtension.sidecar.livenessProbe }}
53+
livenessProbe:
54+
{{- toYaml . | nindent 10 }}
55+
{{- end }}
56+
{{- with .Values.inferenceExtension.sidecar.readinessProbe }}
57+
readinessProbe:
58+
{{- toYaml . | nindent 10 }}
59+
{{- end }}
60+
{{- with .Values.inferenceExtension.sidecar.resources }}
61+
resources:
62+
{{- toYaml . | nindent 10 }}
63+
{{- end }}
64+
{{- with .Values.inferenceExtension.sidecar.volumeMounts }}
65+
volumeMounts:
66+
{{- toYaml . | nindent 10 }}
67+
{{- end }}
68+
{{- end }}
3069
- name: epp
3170
image: {{ .Values.inferenceExtension.image.hub }}/{{ .Values.inferenceExtension.image.name }}:{{ .Values.inferenceExtension.image.tag }}
32-
imagePullPolicy: {{ .Values.inferenceExtension.image.pullPolicy | default "Always" }}
71+
imagePullPolicy: {{ .Values.inferenceExtension.image.pullPolicy | default "IfNotPresent" }}
3372
args:
3473
- --pool-name
3574
- {{ .Release.Name }}
@@ -139,6 +178,9 @@ spec:
139178
- name: plugins-config-volume
140179
mountPath: "/config"
141180
volumes:
181+
{{- if .Values.inferenceExtension.sidecar.volumes }}
182+
{{- tpl (toYaml .Values.inferenceExtension.sidecar.volumes) $ | nindent 6 }}
183+
{{- end }}
142184
- name: plugins-config-volume
143185
configMap:
144186
name: {{ include "gateway-api-inference-extension.name" . }}

config/charts/inferencepool/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ inferenceExtension:
1212
extraContainerPorts: []
1313
# Define additional service ports
1414
extraServicePorts: []
15+
# extraServicePorts:
16+
# - name: http
17+
# port: 8081
18+
# protocol: TCP
19+
# targetPort: 8081
1520

1621
# This is the plugins configuration file.
1722
# pluginsCustomConfig:
@@ -38,6 +43,10 @@ inferenceExtension:
3843
affinity: {}
3944

4045
tolerations: []
46+
47+
# Sidecar configuration for EPP
48+
sidecar:
49+
enabled: false
4150

4251
# Monitoring configuration for EPP
4352
monitoring:

0 commit comments

Comments
 (0)