Skip to content

Commit ae49a66

Browse files
committed
[feat] Support Helm Chart
Signed-off-by: Jiaxin Shan <seedjeffwan@gmail.com>
1 parent d5ca8d6 commit ae49a66

32 files changed

+40613
-0
lines changed

PROJECT

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ domain: aibrix.ai
66
layout:
77
- go.kubebuilder.io/v4
88
multigroup: true
9+
plugins:
10+
helm.kubebuilder.io/v1-alpha: {}
911
projectName: aibrix
1012
repo: github.com/vllm-project/aibrix
1113
resources:

dist/chart/.helmignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Patterns to ignore when building Helm packages.
2+
# Operating system files
3+
.DS_Store
4+
5+
# Version control directories
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.hg/
10+
.hgignore
11+
.svn/
12+
13+
# Backup and temporary files
14+
*.swp
15+
*.tmp
16+
*.bak
17+
*.orig
18+
*~
19+
20+
# IDE and editor-related files
21+
.idea/
22+
.vscode/
23+
24+
# Helm chart artifacts
25+
dist/chart/*.tgz

dist/chart/Chart.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: aibrix
3+
description: A Helm chart to distribute the project aibrix
4+
type: application
5+
version: 0.3.0
6+
appVersion: "0.3.0"
7+
icon: "https://example.com/icon.png"

dist/chart/README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# AIBrix Helm Chart
2+
3+
This Helm chart manages the deployment of AIBrix components using Kubernetes-native workflows. It was initially generated using:
4+
5+
```
6+
kubebuilder edit --plugins=helm/v1-alpha
7+
```
8+
and is now manually maintained under `dist/chart`.
9+
10+
11+
## Limitations
12+
13+
1. Missing Standard Labels
14+
Common Kubernetes labels such as `app.kubernetes.io/managed-by` and `app.kubernetes.io/name` are currently not included. These should be added to improve consistency and observability.
15+
16+
2. Third-Party Dependencies Not Included
17+
Dependencies like `Envoy Gateway` and `KubeRay` have their own Helm charts. This AIBrix chart focuses only on core AIBrix components and does not package or manage external dependencies.
18+
19+
3. Not Compatible with Previous Kustomize-Based Installs
20+
This chart is not intended for upgrades from earlier deployments that used Kustomize. Transitioning requires a clean install.
21+
22+
23+
## Development
24+
25+
### Helm Lint
26+
27+
Run the following to validate the chart, If you encounter errors such as:
28+
29+
```
30+
helm lint dist/chart
31+
==> Linting dist/chart
32+
[ERROR] templates/: template: aibrix/templates/gateway-instance/gateway.yaml:76:39: executing "aibrix/templates/gateway-instance/gateway.yaml" at <.Values.gateway.envoyProxy.container.shutdown.image>: nil pointer evaluating interface {}.image
33+
34+
Error: 1 chart(s) linted, 1 chart(s) failed
35+
```
36+
37+
resolve the issue and retry until you get:
38+
```
39+
helm lint dist/chart
40+
==> Linting dist/chart
41+
42+
1 chart(s) linted, 0 chart(s) failed
43+
```
44+
45+
### Render yaml files
46+
47+
Render all manifests using:
48+
```
49+
helm template aibrix dist/chart -f dist/chart/values.yaml --namespace aibrix-system --debug > verify.yaml
50+
install.go:222: [debug] Original chart version: ""
51+
install.go:239: [debug] CHART PATH: /Users/username/workspace/aibrix/dist/chart
52+
```
53+
54+
You can also render a specific component for targeted debugging:
55+
56+
```
57+
helm template aibrix dist/chart --show-only templates/gateway-plugin/deployment.yaml
58+
```
59+
60+
### Runtime Debugging
61+
62+
Helm lint only catches syntax and static issues. If components are not appearing as expected (e.g., pods not running), check the live Kubernetes objects:
63+
64+
Sample error:
65+
```
66+
---- ------ ---- ---- -------
67+
Warning FailedCreate 10s (x17 over 5m39s) replicaset-controller Error creating: pods "aibrix-gateway-plugins-58cdbc746f-" is forbidden: error looking up service account aibrix-system/aibrix-gateway-plugin: serviceaccount "aibrix-gateway-plugin" not found
68+
```
69+
Ensure all required resources (e.g., ServiceAccounts) are declared in the chart or created manually beforehand.
70+
71+
72+
## Installation
73+
74+
### Dependencies
75+
76+
Apply required dependencies:
77+
```
78+
kubectl apply -k config/dependency --server-side
79+
```
80+
81+
Install KubeRay operator (used by some AIBrix workloads):
82+
```
83+
helm install kuberay-operator kuberay/kuberay-operator \
84+
--namespace kuberay-system \
85+
--version 1.2.1 \
86+
--include-crds \
87+
--set env[0].name=ENABLE_PROBES_INJECTION \
88+
--set-string env[0].value=false \
89+
--set fullnameOverride=kuberay-operator \
90+
--set featureGates[0].name=RayClusterStatusConditions \
91+
--set featureGates[0].enabled=true
92+
```
93+
94+
### CRDs
95+
96+
`--install-crds` is not available in local chart installation. We need to manually install it.
97+
98+
```
99+
kubectl apply -f dist/chart/crds/ --server-side
100+
```
101+
102+
### Helm Install
103+
104+
Install AIBrix with the default values:
105+
```
106+
helm install aibrix dist/chart -n aibrix-system --create-namespace
107+
```
108+
109+
Or use a custom values file:
110+
111+
```
112+
helm install aibrix dist/chart -f my-values.yaml -n aibrix-system --create-namespace
113+
```
114+
115+
116+
### Verification
117+
118+
```
119+
helm list -A
120+
kubectl get all -n aibrix-system
121+
```
122+
123+
124+
### Helm upgrade
125+
126+
Upgrade to the latest chart version:
127+
```
128+
helm upgrade aibrix dist/chart -n aibrix-system
129+
130+
```
131+
132+
133+
### Helm Uninstall
134+
135+
Remove the release:
136+
```
137+
helm uninstall aibrix -n aibrix-system
138+
```
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
labels:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.16.1
8+
name: podautoscalers.autoscaling.aibrix.ai
9+
spec:
10+
group: autoscaling.aibrix.ai
11+
names:
12+
kind: PodAutoscaler
13+
listKind: PodAutoscalerList
14+
plural: podautoscalers
15+
singular: podautoscaler
16+
scope: Namespaced
17+
versions:
18+
- name: v1alpha1
19+
schema:
20+
openAPIV3Schema:
21+
properties:
22+
apiVersion:
23+
type: string
24+
kind:
25+
type: string
26+
metadata:
27+
type: object
28+
spec:
29+
properties:
30+
maxReplicas:
31+
format: int32
32+
type: integer
33+
metricsSources:
34+
items:
35+
properties:
36+
endpoint:
37+
type: string
38+
metricSourceType:
39+
enum:
40+
- pod
41+
- domain
42+
type: string
43+
path:
44+
type: string
45+
port:
46+
type: string
47+
protocolType:
48+
enum:
49+
- http
50+
- https
51+
type: string
52+
targetMetric:
53+
type: string
54+
targetValue:
55+
type: string
56+
required:
57+
- metricSourceType
58+
- path
59+
- protocolType
60+
- targetMetric
61+
- targetValue
62+
type: object
63+
minItems: 1
64+
type: array
65+
minReplicas:
66+
format: int32
67+
type: integer
68+
scaleTargetRef:
69+
properties:
70+
apiVersion:
71+
type: string
72+
fieldPath:
73+
type: string
74+
kind:
75+
type: string
76+
name:
77+
type: string
78+
namespace:
79+
type: string
80+
resourceVersion:
81+
type: string
82+
uid:
83+
type: string
84+
type: object
85+
x-kubernetes-map-type: atomic
86+
scalingStrategy:
87+
enum:
88+
- HPA
89+
- KPA
90+
- APA
91+
type: string
92+
required:
93+
- maxReplicas
94+
- scaleTargetRef
95+
- scalingStrategy
96+
type: object
97+
status:
98+
properties:
99+
actualScale:
100+
format: int32
101+
type: integer
102+
conditions:
103+
items:
104+
properties:
105+
lastTransitionTime:
106+
format: date-time
107+
type: string
108+
message:
109+
maxLength: 32768
110+
type: string
111+
observedGeneration:
112+
format: int64
113+
minimum: 0
114+
type: integer
115+
reason:
116+
maxLength: 1024
117+
minLength: 1
118+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
119+
type: string
120+
status:
121+
enum:
122+
- "True"
123+
- "False"
124+
- Unknown
125+
type: string
126+
type:
127+
maxLength: 316
128+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
129+
type: string
130+
required:
131+
- lastTransitionTime
132+
- message
133+
- reason
134+
- status
135+
- type
136+
type: object
137+
type: array
138+
desiredScale:
139+
format: int32
140+
type: integer
141+
lastScaleTime:
142+
format: date-time
143+
type: string
144+
type: object
145+
type: object
146+
served: true
147+
storage: true
148+
subresources:
149+
status: {}

0 commit comments

Comments
 (0)