-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add aisix Helm chart #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AlinsRan
wants to merge
16
commits into
main
Choose a base branch
from
feat/aisix-helm-chart-clean
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7fe8cd8
feat: add aisix helm chart scaffold (Chart.yaml, values.yaml, helpers…
AlinsRan cfa3a04
feat(aisix): add ConfigMap template for config.yaml
AlinsRan d070967
feat(aisix): add Deployment template
AlinsRan e440565
feat(aisix): add Service, Ingress, and HPA templates
AlinsRan 0ea1e1b
feat(aisix): add NOTES.txt, chart README, and update top-level README
AlinsRan 73965e7
feat(aisix): add Chart.lock and vendored etcd subchart
AlinsRan 932d1cd
fix(aisix): correct image tag and appVersion to 0.1.0
AlinsRan a8feeae
fix(aisix): use api7/etcd image for etcd subchart
AlinsRan eca980e
fix(aisix): align etcd defaults with gateway chart (disabled by defau…
AlinsRan 6f0de84
refactor(aisix): restructure proxy/admin into gateway and admin block…
AlinsRan c4cbbc9
fix(aisix): address review comments
AlinsRan 77c6cbb
docs(aisix): regenerate README with helm-docs
AlinsRan d4c1beb
docs(aisix): add control plane connection guide to README
AlinsRan 4a6f013
docs(aisix): remove README.md.gotmpl and regenerate README
AlinsRan 087c061
fix(aisix): address review comments
AlinsRan 9a0cfe1
fix(aisix): address remaining review comments
AlinsRan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Patterns to ignore when building packages. | ||
| .DS_Store | ||
| .git/ | ||
| .gitignore | ||
| .gitmodules | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| .vscode/ | ||
| *.tmproj | ||
| .idea/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| dependencies: | ||
| - name: etcd | ||
| repository: https://charts.bitnami.com/bitnami | ||
| version: 8.7.7 | ||
| digest: sha256:c03ff5323e855335d94ce6cfce35745b84d03538dbb197e1a27520a7d69ea3ef | ||
| generated: "2026-04-15T17:14:56.064889296+08:00" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| apiVersion: v2 | ||
| name: aisix | ||
| description: A Helm chart for AISIX AI Gateway | ||
|
|
||
| type: application | ||
|
|
||
| version: 0.1.0 | ||
|
|
||
| appVersion: "0.1.0" | ||
|
|
||
| maintainers: | ||
| - name: API7 | ||
| email: support@api7.ai | ||
| url: https://api7.ai | ||
|
|
||
| dependencies: | ||
| - name: etcd | ||
| version: 8.7.7 | ||
| repository: https://charts.bitnami.com/bitnami | ||
| condition: etcd.enabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # AISIX Helm Chart | ||
|
|
||
| A Helm chart for [AISIX](https://github.com/api7/aisix) — an open source, high-performance AI Gateway and LLM proxy built in Rust. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Kubernetes 1.21+ | ||
| - Helm 3.7+ | ||
|
|
||
| ## Installing the Chart | ||
|
|
||
| ```bash | ||
| helm repo add api7 https://charts.api7.ai | ||
| helm repo update | ||
|
|
||
| helm install my-aisix api7/aisix \ | ||
| --set deployment.admin.adminKey[0].key=<your-admin-key> | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| ## Uninstalling the Chart | ||
|
|
||
| ```bash | ||
| helm uninstall my-aisix | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| The following table lists the key configurable parameters. See `values.yaml` for the full list. | ||
|
|
||
| | Parameter | Description | Default | | ||
| |-----------|-------------|---------| | ||
| | `image.repository` | AISIX image repository | `ghcr.io/api7/aisix` | | ||
|
AlinsRan marked this conversation as resolved.
Outdated
|
||
| | `image.tag` | AISIX image tag | `0.1.0` | | ||
| | `replicaCount` | Number of replicas | `1` | | ||
|
AlinsRan marked this conversation as resolved.
Outdated
|
||
| | `deployment.admin.adminKey` | Admin API key list | `[{key: "changeme"}]` | | ||
| | `deployment.admin.existingSecret` | Existing Secret for admin key | `""` | | ||
| | `deployment.etcd.host` | External etcd hosts (when `etcd.enabled=false`) | `["http://etcd.host:2379"]` | | ||
| | `deployment.etcd.prefix` | etcd key prefix | `/aisix` | | ||
| | `server.proxy.listen` | Proxy API listen address | `0.0.0.0:3000` | | ||
| | `server.admin.listen` | Admin API listen address | `0.0.0.0:3001` | | ||
| | `proxyService.type` | Proxy Service type | `NodePort` | | ||
| | `adminService.type` | Admin Service type | `ClusterIP` | | ||
| | `etcd.enabled` | Install bundled etcd | `true` | | ||
|
AlinsRan marked this conversation as resolved.
Outdated
|
||
| | `ingress.enabled` | Enable Ingress for proxy | `false` | | ||
| | `adminIngress.enabled` | Enable Ingress for admin | `false` | | ||
| | `autoscaling.enabled` | Enable HPA | `false` | | ||
|
|
||
| ## Using an Existing Secret for the Admin Key | ||
|
|
||
| ```bash | ||
| kubectl create secret generic aisix-admin-secret \ | ||
| --from-literal=admin-key=<your-strong-key> | ||
|
|
||
| helm install my-aisix api7/aisix \ | ||
| --set deployment.admin.existingSecret=aisix-admin-secret | ||
| ``` | ||
|
|
||
| ## Using an External etcd | ||
|
|
||
| ```bash | ||
| helm install my-aisix api7/aisix \ | ||
| --set etcd.enabled=false \ | ||
| --set deployment.etcd.host[0]="http://my-etcd:2379" \ | ||
| --set deployment.admin.adminKey[0].key=<your-admin-key> | ||
| ``` | ||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| AISIX has been installed. Check its status by running: | ||
| kubectl --namespace {{ .Release.Namespace }} get pods -l "app.kubernetes.io/name={{ include "aisix.name" . }}" | ||
|
|
||
| 1. Get the Proxy API URL: | ||
| {{- if .Values.gateway.ingress.enabled }} | ||
| {{- range .Values.gateway.ingress.hosts }} | ||
| http{{ if $.Values.gateway.ingress.tls }}s{{ end }}://{{ .host }} | ||
| {{- end }} | ||
| {{- else if eq .Values.gateway.type "NodePort" }} | ||
| export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "aisix.fullname" . }}-gateway) | ||
| export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
| echo "Proxy API: http://$NODE_IP:$NODE_PORT" | ||
| {{- else if eq .Values.gateway.type "LoadBalancer" }} | ||
| NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
| export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "aisix.fullname" . }}-gateway --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") | ||
| echo "Proxy API: http://$SERVICE_IP:{{ .Values.gateway.servicePort }}" | ||
| {{- else }} | ||
| export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aisix.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
| kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3000:{{ .Values.gateway.containerPort }} | ||
| echo "Proxy API: http://127.0.0.1:3000" | ||
| {{- end }} | ||
|
|
||
| 2. Get the Admin UI URL: | ||
| {{- if .Values.admin.enabled }} | ||
| {{- if .Values.admin.ingress.enabled }} | ||
| {{- range .Values.admin.ingress.hosts }} | ||
| http{{ if $.Values.admin.ingress.tls }}s{{ end }}://{{ .host }}/ui | ||
| {{- end }} | ||
| {{- else }} | ||
| export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "aisix.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
| kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3001:{{ .Values.admin.containerPort }} | ||
| echo "Admin UI: http://127.0.0.1:3001/ui" | ||
| echo "Admin API: http://127.0.0.1:3001/aisix/admin" | ||
| {{- end }} | ||
| {{- else }} | ||
| Admin service is disabled. Enable it with --set admin.enabled=true | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| {{/* vim: set filetype=mustache: */}} | ||
| {{/* | ||
| Expand the name of the chart. | ||
| */}} | ||
| {{- define "aisix.name" -}} | ||
| {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create a default fully qualified app name. | ||
| We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
| If release name contains chart name it will be used as a full name. | ||
| */}} | ||
| {{- define "aisix.fullname" -}} | ||
| {{- if .Values.fullnameOverride }} | ||
| {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- $name := default .Chart.Name .Values.nameOverride }} | ||
| {{- if contains $name .Release.Name }} | ||
| {{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
| {{- else }} | ||
| {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create chart name and version as used by the chart label. | ||
| */}} | ||
| {{- define "aisix.chart" -}} | ||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Common labels | ||
| */}} | ||
| {{- define "aisix.labels" -}} | ||
| helm.sh/chart: {{ include "aisix.chart" . }} | ||
| {{ include "aisix.selectorLabels" . }} | ||
| {{- if .Chart.AppVersion }} | ||
| app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
| {{- end }} | ||
| app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Selector labels | ||
| */}} | ||
| {{- define "aisix.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "aisix.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Create the name of the service account to use | ||
| */}} | ||
| {{- define "aisix.serviceAccountName" -}} | ||
| {{- if .Values.serviceAccount.create }} | ||
| {{- default (include "aisix.fullname" .) .Values.serviceAccount.name }} | ||
| {{- else }} | ||
| {{- default "default" .Values.serviceAccount.name }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Scheme to use while connecting etcd | ||
| */}} | ||
| {{- define "aisix.etcd.scheme" -}} | ||
| {{- if .Values.etcd.auth.tls.enabled }} | ||
| {{- "https" }} | ||
| {{- else }} | ||
| {{- "http" }} | ||
| {{- end }} | ||
| {{- end }} | ||
|
|
||
| {{/* | ||
| Etcd host URL(s) to inject into config.yaml. | ||
| When etcd subchart is enabled, construct the in-cluster FQDN automatically. | ||
| When disabled, use the user-supplied deployment.etcd.host list. | ||
| */}} | ||
| {{- define "aisix.etcd.hosts" -}} | ||
| {{- if .Values.etcd.enabled }} | ||
| {{- $scheme := include "aisix.etcd.scheme" . }} | ||
| {{- if .Values.etcd.fullnameOverride }} | ||
| - "{{ $scheme }}://{{ .Values.etcd.fullnameOverride }}:{{ .Values.etcd.service.port }}" | ||
| {{- else }} | ||
| - "{{ $scheme }}://{{ .Release.Name }}-etcd.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.etcd.service.port }}" | ||
| {{- end }} | ||
| {{- else }} | ||
| {{- toYaml .Values.deployment.etcd.host }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "aisix.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "aisix.labels" . | nindent 4 }} | ||
| data: | ||
| config.yaml: |- | ||
| deployment: | ||
| etcd: | ||
| host: | ||
| {{- include "aisix.etcd.hosts" . | nindent 10 }} | ||
| prefix: {{ .Values.deployment.etcd.prefix | quote }} | ||
| timeout: {{ .Values.deployment.etcd.timeout }} | ||
| admin: | ||
| admin_key: | ||
| {{- if .Values.deployment.admin.existingSecret }} | ||
| - key: "{{"{{"}}AISIX_ADMIN_KEY{{"}}"}}" | ||
| {{- else }} | ||
| {{- toYaml .Values.deployment.admin.adminKey | nindent 10 }} | ||
| {{- end }} | ||
|
AlinsRan marked this conversation as resolved.
Outdated
|
||
|
|
||
| server: | ||
| proxy: | ||
| listen: "{{ .Values.gateway.ip }}:{{ .Values.gateway.containerPort }}" | ||
| tls: | ||
| enabled: false | ||
| admin: | ||
| listen: "{{ .Values.admin.ip }}:{{ .Values.admin.containerPort }}" | ||
|
coderabbitai[bot] marked this conversation as resolved.
AlinsRan marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "aisix.fullname" . }} | ||
| namespace: {{ .Release.Namespace }} | ||
| labels: | ||
| {{- include "aisix.labels" . | nindent 4 }} | ||
| spec: | ||
| {{- if not .Values.autoscaling.enabled }} | ||
| replicas: {{ .Values.replicaCount }} | ||
| {{- end }} | ||
| selector: | ||
| matchLabels: | ||
| {{- include "aisix.selectorLabels" . | nindent 6 }} | ||
| {{- if .Values.updateStrategy }} | ||
| strategy: {{ toYaml .Values.updateStrategy | nindent 4 }} | ||
| {{- end }} | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} | ||
|
AlinsRan marked this conversation as resolved.
|
||
| {{- with .Values.podAnnotations }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| labels: | ||
| {{- include "aisix.selectorLabels" . | nindent 8 }} | ||
| {{- with .Values.podLabels }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| {{- with .Values.global.imagePullSecrets }} | ||
| imagePullSecrets: | ||
| {{- toYaml . | nindent 8 }} | ||
|
AlinsRan marked this conversation as resolved.
Outdated
|
||
| {{- end }} | ||
| serviceAccountName: {{ include "aisix.serviceAccountName" . }} | ||
| {{- with .Values.podSecurityContext }} | ||
| securityContext: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.extraInitContainers }} | ||
| initContainers: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| containers: | ||
| - name: aisix | ||
| {{- with .Values.securityContext }} | ||
| securityContext: | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
| imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
| ports: | ||
| - name: proxy | ||
| containerPort: {{ .Values.gateway.containerPort }} | ||
| protocol: TCP | ||
| {{- if .Values.admin.enabled }} | ||
| - name: admin | ||
| containerPort: {{ .Values.admin.containerPort }} | ||
| protocol: TCP | ||
| {{- end }} | ||
| {{- if .Values.livenessProbe }} | ||
| livenessProbe: | ||
| {{- toYaml .Values.livenessProbe | nindent 12 }} | ||
| {{- end }} | ||
| {{- if .Values.readinessProbe }} | ||
| readinessProbe: | ||
| {{- toYaml .Values.readinessProbe | nindent 12 }} | ||
| {{- end }} | ||
| {{- with .Values.resources }} | ||
| resources: | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| env: | ||
| {{- if .Values.timezone }} | ||
| - name: TZ | ||
| value: {{ .Values.timezone | quote }} | ||
| {{- end }} | ||
| - name: RUST_LOG | ||
| value: "info" | ||
| {{- if .Values.deployment.admin.existingSecret }} | ||
| - name: AISIX_ADMIN_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: {{ .Values.deployment.admin.existingSecret }} | ||
| key: {{ .Values.deployment.admin.existingSecretKey }} | ||
| {{- end }} | ||
| {{- with .Values.extraEnvVars }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| {{- if .Values.extraEnvVarsCM }} | ||
| envFrom: | ||
| - configMapRef: | ||
| name: {{ .Values.extraEnvVarsCM }} | ||
|
AlinsRan marked this conversation as resolved.
Outdated
AlinsRan marked this conversation as resolved.
Outdated
|
||
| {{- end }} | ||
| volumeMounts: | ||
| - name: aisix-config | ||
| mountPath: /etc/aisix/config.yaml | ||
| subPath: config.yaml | ||
| readOnly: true | ||
| {{- with .Values.extraVolumeMounts }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
| volumes: | ||
| - name: aisix-config | ||
| configMap: | ||
| name: {{ include "aisix.fullname" . }} | ||
| {{- with .Values.extraVolumes }} | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.nodeSelector }} | ||
| nodeSelector: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.affinity }} | ||
| affinity: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
| {{- with .Values.tolerations }} | ||
| tolerations: | ||
| {{- toYaml . | nindent 8 }} | ||
| {{- end }} | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.