feat(aisix-cloud): add AISIX private-deployment control-plane chart#298
feat(aisix-cloud): add AISIX private-deployment control-plane chart#298jarvis9443 wants to merge 2 commits into
Conversation
Publishes the AISIX control plane (cp-api, dp-manager, dashboard) as a public Helm chart so users can `helm install api7/aisix-cloud` from https://charts.api7.ai (#789). Ported from the AISIX-Cloud repo's internal chart, with the image tags defaulting to the chart appVersion (and the DP image to ghcr.io/api7/aisix:<appVersion>) so a versioned install pulls matching release images. Uses the aisix-cp-* image names. Added to ct lint and helm-docs; install coverage lives in the AISIX-Cloud ci-helm pipeline.
📝 WalkthroughWalkthroughAdds a complete new Changesaisix-cloud Helm Chart
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@charts/aisix-cloud/templates/_helpers.tpl`:
- Around line 131-143: The aisix-cloud.pgSecretName template definition does not
check for postgresql.auth.existingSecret when postgresql.builtin is true,
causing the template to always return a generated secret name and ignore any
existing secret the user has configured. In the builtin branch (the first if
block starting with postgresql.builtin), add a condition to check if
postgresql.auth.existingSecret is set and return that value before falling back
to checking postgresql.fullnameOverride or the default generated PostgreSQL
secret name.
In `@charts/aisix-cloud/templates/NOTES.txt`:
- Line 33: The NOTES.txt file contains a hardcoded reference to
ghcr.io/api7/aisix:dev which uses the mutable dev tag instead of a versioned
release tag. Replace the :dev tag suffix with a Helm template variable that
references the actual chart version or app version (typically using {{
.Chart.AppVersion }} or {{ .Chart.Version }}) to ensure users are directed to
stable, versioned images that align with the chart's versioned-install contract.
In `@charts/aisix-cloud/templates/ui-deployment.yaml`:
- Line 4: The metadata.name field in the ui-deployment.yaml file contains an
unquoted Helm template expression that can cause YAML parsing failures when
tooling reads the template before Helm rendering. Wrap the entire value of the
name field (which contains the include "aisix-cloud.fullname" helper and the
"-ui" suffix) in double quotes to properly escape the template expression and
prevent YAML parser breakage.
In `@charts/aisix-cloud/templates/ui-service.yaml`:
- Line 4: The metadata.name field in the ui-service.yaml template contains an
unquoted templated value that poses a YAML parsing risk. Wrap the templated
value `{{ include "aisix-cloud.fullname" . }}-ui` in quotes (either single or
double) to ensure proper YAML parsing and compatibility with static analysis
tools. This change should be applied to the name field in the metadata section
to match the same quoting pattern that should be used for templated values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 67e91771-78d6-435a-8c86-c8a240ea1852
⛔ Files ignored due to path filters (1)
charts/aisix-cloud/Chart.lockis excluded by!**/*.lock
📒 Files selected for processing (18)
.github/workflows/ci.yamlAGENTS.mdcharts/aisix-cloud/.helmignorecharts/aisix-cloud/Chart.yamlcharts/aisix-cloud/README.mdcharts/aisix-cloud/charts/postgresql-12.12.10.tgzcharts/aisix-cloud/templates/NOTES.txtcharts/aisix-cloud/templates/_helpers.tplcharts/aisix-cloud/templates/api-deployment.yamlcharts/aisix-cloud/templates/api-service.yamlcharts/aisix-cloud/templates/dpm-deployment.yamlcharts/aisix-cloud/templates/dpm-service.yamlcharts/aisix-cloud/templates/external-db-secret.yamlcharts/aisix-cloud/templates/secret.yamlcharts/aisix-cloud/templates/serviceaccount.yamlcharts/aisix-cloud/templates/ui-deployment.yamlcharts/aisix-cloud/templates/ui-service.yamlcharts/aisix-cloud/values.yaml
| {{- define "aisix-cloud.pgSecretName" -}} | ||
| {{- if .Values.postgresql.builtin }} | ||
| {{- if .Values.postgresql.fullnameOverride }} | ||
| {{- .Values.postgresql.fullnameOverride }} | ||
| {{- else }} | ||
| {{- printf "%s-postgresql" .Release.Name }} | ||
| {{- end }} | ||
| {{- else if .Values.externalDatabase.existingSecret }} | ||
| {{- .Values.externalDatabase.existingSecret }} | ||
| {{- else }} | ||
| {{- printf "%s-external-db" (include "aisix-cloud.fullname" .) }} | ||
| {{- end }} | ||
| {{- end }} |
There was a problem hiding this comment.
Honor postgresql.auth.existingSecret in builtin secret-name resolution.
At Line 132, builtin mode always resolves to the generated PostgreSQL secret name, so when postgresql.auth.existingSecret is set, app pods can reference a non-existent secret and fail startup.
🔧 Proposed fix
{{- define "aisix-cloud.pgSecretName" -}}
{{- if .Values.postgresql.builtin }}
-{{- if .Values.postgresql.fullnameOverride }}
+{{- if .Values.postgresql.auth.existingSecret }}
+{{- .Values.postgresql.auth.existingSecret }}
+{{- else if .Values.postgresql.fullnameOverride }}
{{- .Values.postgresql.fullnameOverride }}
{{- else }}
{{- printf "%s-postgresql" .Release.Name }}
{{- end }}
{{- else if .Values.externalDatabase.existingSecret }}
{{- .Values.externalDatabase.existingSecret }}
{{- else }}
{{- printf "%s-external-db" (include "aisix-cloud.fullname" .) }}
{{- end }}
{{- end }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@charts/aisix-cloud/templates/_helpers.tpl` around lines 131 - 143, The
aisix-cloud.pgSecretName template definition does not check for
postgresql.auth.existingSecret when postgresql.builtin is true, causing the
template to always return a generated secret name and ignore any existing secret
the user has configured. In the builtin branch (the first if block starting with
postgresql.builtin), add a condition to check if postgresql.auth.existingSecret
is set and return that value before falling back to checking
postgresql.fullnameOverride or the default generated PostgreSQL secret name.
| -e AISIX_MANAGED__CP_KEY_PEM='<client-key-pem>' \ | ||
| -e AISIX_MANAGED__CP_CA_PEM='<ca-cert-pem>' \ | ||
| -v aisix-mtls:/var/lib/aisix \ | ||
| ghcr.io/api7/aisix:dev |
There was a problem hiding this comment.
Use a versioned DP image in notes instead of :dev.
Line 33 hardcodes ghcr.io/api7/aisix:dev, which conflicts with the chart’s versioned-install contract and can point users to mutable/non-release images.
Suggested fix
- ghcr.io/api7/aisix:dev
+ {{ .Values.api.dpImage | default (printf "ghcr.io/api7/aisix:%s" .Chart.AppVersion) }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ghcr.io/api7/aisix:dev | |
| {{ .Values.api.dpImage | default (printf "ghcr.io/api7/aisix:%s" .Chart.AppVersion) }} |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@charts/aisix-cloud/templates/NOTES.txt` at line 33, The NOTES.txt file
contains a hardcoded reference to ghcr.io/api7/aisix:dev which uses the mutable
dev tag instead of a versioned release tag. Replace the :dev tag suffix with a
Helm template variable that references the actual chart version or app version
(typically using {{ .Chart.AppVersion }} or {{ .Chart.Version }}) to ensure
users are directed to stable, versioned images that align with the chart's
versioned-install contract.
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "aisix-cloud.fullname" . }}-ui |
There was a problem hiding this comment.
Quote templated metadata.name to avoid YAML parser/lint breakage.
Line 4 is vulnerable to raw-YAML parsing failures (matching the reported syntax error) when tooling reads templates before Helm rendering.
Suggested fix
- name: {{ include "aisix-cloud.fullname" . }}-ui
+ name: '{{ include "aisix-cloud.fullname" . }}-ui'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| name: {{ include "aisix-cloud.fullname" . }}-ui | |
| name: '{{ include "aisix-cloud.fullname" . }}-ui' |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 4-4: syntax error: expected , but found ''
(syntax)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@charts/aisix-cloud/templates/ui-deployment.yaml` at line 4, The metadata.name
field in the ui-deployment.yaml file contains an unquoted Helm template
expression that can cause YAML parsing failures when tooling reads the template
before Helm rendering. Wrap the entire value of the name field (which contains
the include "aisix-cloud.fullname" helper and the "-ui" suffix) in double quotes
to properly escape the template expression and prevent YAML parser breakage.
Source: Linters/SAST tools
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "aisix-cloud.fullname" . }}-ui |
There was a problem hiding this comment.
Quote templated metadata.name here as well for YAML tooling compatibility.
Line 4 has the same raw-template YAML parse risk flagged by static analysis.
Suggested fix
- name: {{ include "aisix-cloud.fullname" . }}-ui
+ name: '{{ include "aisix-cloud.fullname" . }}-ui'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| name: {{ include "aisix-cloud.fullname" . }}-ui | |
| name: '{{ include "aisix-cloud.fullname" . }}-ui' |
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 4-4: syntax error: expected , but found ''
(syntax)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@charts/aisix-cloud/templates/ui-service.yaml` at line 4, The metadata.name
field in the ui-service.yaml template contains an unquoted templated value that
poses a YAML parsing risk. Wrap the templated value `{{ include
"aisix-cloud.fullname" . }}-ui` in quotes (either single or double) to ensure
proper YAML parsing and compatibility with static analysis tools. This change
should be applied to the name field in the metadata section to match the same
quoting pattern that should be used for templated values.
Source: Linters/SAST tools
Part of api7/AISIX-Cloud#789 (AISIX CP private/offline deployment).
Publishes the AISIX control plane (cp-api, dp-manager, dashboard) as a public Helm chart so users can install it from
https://charts.api7.ai:Details
api7/AISIX-Cloudhelm/aisix-cloud(that internal copy stays the source of truth — it's what the dev ArgoCD app + ci-helm deploy). Uses theaisix-cp-*image names.ghcr.io/api7/aisix:<appVersion>), so a versioned install pulls matching release images instead of:dev.ingress-controller/developer-portal-fe): chart0.1.0, appVersion0.1.0.ct lint+ helm-docs (README generated). Not added toct install— there's no published release image at the appVersion yet, and real install coverage already runs in the AISIX-Cloudci-helmpipeline (builds images from source + installs into kind).Merge ordering
This chart references
aisix-cp-*:0.1.0/aisix:0.1.0images, which don't exist until the firstv0.1.0release of the data-plane + control-plane repos. Merge this after that release so the published chart resolves to real images. (CI here only lints/renders, so it's green regardless.)Summary by CodeRabbit
New Features
Chores