Skip to content

Commit dc3d6b2

Browse files
committed
feat(charts): Add Gateway API HTTPRoute resources for API and UI
Signed-off-by: Victor Hang <victor@stackhpc.com>
1 parent adb39a5 commit dc3d6b2

3 files changed

Lines changed: 89 additions & 1 deletion

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if and .Values.api.enabled .Values.api.httpRoute.enabled -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: {{ printf "%s-api" .Release.Name }}
6+
labels:
7+
{{- include "azimuth-llm.labels" . | nindent 4 }}
8+
{{- with .Values.api.httpRoute.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
{{- with .Values.api.httpRoute.parentRefs }}
14+
parentRefs:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- with .Values.api.httpRoute.hostnames }}
18+
hostnames:
19+
{{- toYaml . | nindent 4 }}
20+
{{- end }}
21+
rules:
22+
{{- range .Values.api.httpRoute.rules }}
23+
- {{ with .matches }}matches:
24+
{{- toYaml . | nindent 8 }}
25+
{{ end }}backendRefs:
26+
- name: {{ $.Release.Name }}-api
27+
port: 80
28+
{{- end }}
29+
{{- end }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{{- if and .Values.ui.enabled .Values.ui.httpRoute.enabled -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: {{ printf "%s-ui" .Release.Name }}
6+
labels:
7+
{{- include "azimuth-llm.labels" . | nindent 4 }}
8+
{{- with .Values.ui.httpRoute.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
{{- with .Values.ui.httpRoute.parentRefs }}
14+
parentRefs:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- with .Values.ui.httpRoute.hostnames }}
18+
hostnames:
19+
{{- toYaml . | nindent 4 }}
20+
{{- end }}
21+
rules:
22+
{{- range .Values.ui.httpRoute.rules }}
23+
- {{ with .matches }}matches:
24+
{{- toYaml . | nindent 8 }}
25+
{{ end }}backendRefs:
26+
- name: {{ $.Release.Name }}-ui
27+
port: 80
28+
{{- end }}
29+
{{- end }}

charts/azimuth-llm/values.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Default values for azimuth-llm.
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
4-
54
huggingface:
65
# The name of the HuggingFace model to use
76
# Use a yaml anchor to avoid duplication elsewhere
@@ -69,6 +68,22 @@ api:
6968
# - secretName: chart-example-tls
7069
# hosts:
7170
# - chart-example.local
71+
72+
# Gateway API HTTPRoute resource config for backend API
73+
httpRoute:
74+
enabled: true
75+
annotations: {}
76+
parentRefs:
77+
- name: my-gateway
78+
namespace: default
79+
sectionName: https
80+
hostnames:
81+
- chart-example.local
82+
rules:
83+
- matches:
84+
- path:
85+
type: PathPrefix
86+
value: /v1
7287
# Config for huggingface model cache volume
7388
# This is mounted at /root/.cache/huggingface in the api deployment
7489
cacheVolume:
@@ -173,6 +188,21 @@ ui:
173188
# - secretName: chart-example-tls
174189
# hosts:
175190
# - chart-example.local
191+
# Gateway API HTTPRoute resource config for UI web app
192+
httpRoute:
193+
enabled: false
194+
annotations: {}
195+
parentRefs:
196+
- name: my-gateway
197+
namespace: default
198+
sectionName: https
199+
hostnames:
200+
- chart-example.local
201+
rules:
202+
- matches:
203+
- path:
204+
type: PathPrefix
205+
value: /
176206
# The update strategy to use for the deployment
177207
updateStrategy:
178208
rollingUpdate:

0 commit comments

Comments
 (0)