diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db7191e..1566998 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -37,7 +37,7 @@ jobs: --charts charts/api7 \ --charts charts/gateway \ --charts charts/ingress-controller \ - --charts charts/aisix-cloud' + --charts charts/aisix-cp' - name: Verify Chart.lock files run: | diff --git a/AGENTS.md b/AGENTS.md index 2ba2c18..08476f2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ This repo (`api7/api7-helm-chart`) holds the Helm charts for API7 EE components | `gateway` (Data Plane) | `charts/gateway` | yes — appVersion is the EE version | | `api7-ingress-controller` | `charts/ingress-controller` | no — independent product version | | `developer-portal-fe` | `charts/developer-portal-fe` | no — independent product version | -| `aisix-cloud` (AISIX private-deployment control plane) | `charts/aisix-cloud` | no — independent product version (source of truth: `api7/AISIX-Cloud` `helm/aisix-cloud`) | +| `aisix-cp` (AISIX private-deployment control plane) | `charts/aisix-cp` | no — independent product version (source of truth: `api7/AISIX-Cloud` `helm/aisix-cp`) | ## Multi-line maintenance model diff --git a/charts/aisix-cloud/templates/api-service.yaml b/charts/aisix-cloud/templates/api-service.yaml deleted file mode 100644 index 58a9c1c..0000000 --- a/charts/aisix-cloud/templates/api-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "aisix-cloud.fullname" . }}-api - labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "api") | nindent 4 }} -spec: - type: {{ .Values.api.service.type }} - ports: - - port: {{ .Values.api.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "api") | nindent 4 }} diff --git a/charts/aisix-cloud/templates/ui-service.yaml b/charts/aisix-cloud/templates/ui-service.yaml deleted file mode 100644 index 968ebfd..0000000 --- a/charts/aisix-cloud/templates/ui-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "aisix-cloud.fullname" . }}-ui - labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "ui") | nindent 4 }} -spec: - type: {{ .Values.ui.service.type }} - ports: - - port: {{ .Values.ui.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "ui") | nindent 4 }} diff --git a/charts/aisix-cloud/.helmignore b/charts/aisix-cp/.helmignore similarity index 100% rename from charts/aisix-cloud/.helmignore rename to charts/aisix-cp/.helmignore diff --git a/charts/aisix-cloud/Chart.lock b/charts/aisix-cp/Chart.lock similarity index 100% rename from charts/aisix-cloud/Chart.lock rename to charts/aisix-cp/Chart.lock diff --git a/charts/aisix-cloud/Chart.yaml b/charts/aisix-cp/Chart.yaml similarity index 74% rename from charts/aisix-cloud/Chart.yaml rename to charts/aisix-cp/Chart.yaml index 7462896..66e2e51 100644 --- a/charts/aisix-cloud/Chart.yaml +++ b/charts/aisix-cp/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: aisix-cloud -description: Helm chart for AISIX-Cloud control plane (cp-api, dp-manager, dashboard) +name: aisix-cp +description: Helm chart for AISIX control plane (cp-api, dp-manager, dashboard) type: application version: 0.1.0 appVersion: "0.1.0" diff --git a/charts/aisix-cloud/README.md b/charts/aisix-cp/README.md similarity index 95% rename from charts/aisix-cloud/README.md rename to charts/aisix-cp/README.md index d2d8564..902c268 100644 --- a/charts/aisix-cloud/README.md +++ b/charts/aisix-cp/README.md @@ -1,8 +1,8 @@ -# aisix-cloud +# aisix-cp ![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square) -Helm chart for AISIX-Cloud control plane (cp-api, dp-manager, dashboard) +Helm chart for AISIX control plane (cp-api, dp-manager, dashboard) ## Maintainers @@ -25,7 +25,7 @@ Helm chart for AISIX-Cloud control plane (cp-api, dp-manager, dashboard) | api.dpmgrBaseURL | string | `""` | | | api.extraEnvVars | list | `[]` | | | api.image.pullPolicy | string | `"IfNotPresent"` | | -| api.image.repository | string | `"ghcr.io/api7/aisix-cp-api"` | | +| api.image.repository | string | `"docker.io/api7/aisix-cp-api"` | | | api.image.tag | string | `""` | | | api.nodeSelector | object | `{}` | | | api.oauthEnabled | bool | `false` | | @@ -49,7 +49,7 @@ Helm chart for AISIX-Cloud control plane (cp-api, dp-manager, dashboard) | dpm.affinity | object | `{}` | | | dpm.extraEnvVars | list | `[]` | | | dpm.image.pullPolicy | string | `"IfNotPresent"` | | -| dpm.image.repository | string | `"ghcr.io/api7/aisix-cp-dpm"` | | +| dpm.image.repository | string | `"docker.io/api7/aisix-cp-dpm"` | | | dpm.image.tag | string | `""` | | | dpm.nodeSelector | object | `{}` | | | dpm.podSecurityContext.fsGroup | int | `101` | | @@ -101,7 +101,7 @@ Helm chart for AISIX-Cloud control plane (cp-api, dp-manager, dashboard) | ui.defaultLocale | string | `"en"` | | | ui.extraEnvVars | list | `[]` | | | ui.image.pullPolicy | string | `"IfNotPresent"` | | -| ui.image.repository | string | `"ghcr.io/api7/aisix-cp-ui"` | | +| ui.image.repository | string | `"docker.io/api7/aisix-cp-ui"` | | | ui.image.tag | string | `""` | | | ui.nodeSelector | object | `{}` | | | ui.podSecurityContext.fsGroup | int | `65533` | | diff --git a/charts/aisix-cloud/charts/postgresql-12.12.10.tgz b/charts/aisix-cp/charts/postgresql-12.12.10.tgz similarity index 100% rename from charts/aisix-cloud/charts/postgresql-12.12.10.tgz rename to charts/aisix-cp/charts/postgresql-12.12.10.tgz diff --git a/charts/aisix-cloud/templates/NOTES.txt b/charts/aisix-cp/templates/NOTES.txt similarity index 50% rename from charts/aisix-cloud/templates/NOTES.txt rename to charts/aisix-cp/templates/NOTES.txt index 167e878..57bf8fa 100644 --- a/charts/aisix-cloud/templates/NOTES.txt +++ b/charts/aisix-cp/templates/NOTES.txt @@ -1,13 +1,13 @@ -AISIX-Cloud control plane has been deployed. +AISIX control plane has been deployed. Components: - - cp-api: {{ include "aisix-cloud.fullname" . }}-api:{{ .Values.api.service.port }} - - dp-manager: {{ include "aisix-cloud.fullname" . }}-dpm:{{ .Values.dpm.service.port }} - - dashboard: {{ include "aisix-cloud.fullname" . }}-ui:{{ .Values.ui.service.port }} - - PostgreSQL: {{ include "aisix-cloud.pgHost" . }}:{{ include "aisix-cloud.pgPort" . }} + - cp-api: {{ include "aisix-cp.fullname" . }}-api:{{ .Values.api.service.port }} + - dp-manager: {{ include "aisix-cp.fullname" . }}-dpm:{{ .Values.dpm.service.port }} + - dashboard: {{ include "aisix-cp.fullname" . }}-ui:{{ .Values.ui.service.port }} + - PostgreSQL: {{ include "aisix-cp.pgHost" . }}:{{ include "aisix-cp.pgPort" . }} Access the dashboard via cp-api (reverse proxy): - kubectl port-forward svc/{{ include "aisix-cloud.fullname" . }}-api {{ .Values.api.service.port }}:{{ .Values.api.service.port }} -n {{ .Release.Namespace }} + kubectl port-forward svc/{{ include "aisix-cp.fullname" . }}-api {{ .Values.api.service.port }}:{{ .Values.api.service.port }} -n {{ .Release.Namespace }} Then open http://localhost:{{ .Values.api.service.port }} Connect a data-plane (managed mode): @@ -17,7 +17,7 @@ Connect a data-plane (managed mode): NodePort: {{ .Values.dpm.service.nodePort }} {{- else }} Get the assigned port: - kubectl get svc/{{ include "aisix-cloud.fullname" . }}-dpm -n {{ .Release.Namespace }} -o jsonpath='{.spec.ports[0].nodePort}' + kubectl get svc/{{ include "aisix-cp.fullname" . }}-dpm -n {{ .Release.Namespace }} -o jsonpath='{.spec.ports[0].nodePort}' {{- end }} Run the DP container (replace and with actual values): @@ -30,8 +30,8 @@ Connect a data-plane (managed mode): -e AISIX_MANAGED__CP_KEY_PEM='' \ -e AISIX_MANAGED__CP_CA_PEM='' \ -v aisix-mtls:/var/lib/aisix \ - {{ .Values.api.dpImage | default (printf "ghcr.io/api7/aisix:%s" .Chart.AppVersion) }} + {{ .Values.api.dpImage | default (printf "docker.io/api7/aisix:%s" .Chart.AppVersion) }} {{- else }} DPM is a ClusterIP service. Expose it via Ingress, LoadBalancer, or port-forward: - kubectl port-forward svc/{{ include "aisix-cloud.fullname" . }}-dpm {{ .Values.dpm.service.port }}:{{ .Values.dpm.service.port }} -n {{ .Release.Namespace }} + kubectl port-forward svc/{{ include "aisix-cp.fullname" . }}-dpm {{ .Values.dpm.service.port }}:{{ .Values.dpm.service.port }} -n {{ .Release.Namespace }} {{- end }} diff --git a/charts/aisix-cloud/templates/_helpers.tpl b/charts/aisix-cp/templates/_helpers.tpl similarity index 70% rename from charts/aisix-cloud/templates/_helpers.tpl rename to charts/aisix-cp/templates/_helpers.tpl index ce723c7..88ed660 100644 --- a/charts/aisix-cloud/templates/_helpers.tpl +++ b/charts/aisix-cp/templates/_helpers.tpl @@ -1,14 +1,14 @@ {{/* Expand the name of the chart. */}} -{{- define "aisix-cloud.name" -}} +{{- define "aisix-cp.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create a default fully qualified app name. */}} -{{- define "aisix-cloud.fullname" -}} +{{- define "aisix-cp.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -24,25 +24,25 @@ Create a default fully qualified app name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "aisix-cloud.chart" -}} +{{- define "aisix-cp.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "aisix-cloud.labels" -}} -helm.sh/chart: {{ include "aisix-cloud.chart" . }} +{{- define "aisix-cp.labels" -}} +helm.sh/chart: {{ include "aisix-cp.chart" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/part-of: aisix-cloud +app.kubernetes.io/part-of: aisix-cp {{- end }} {{/* Selector labels for a component. -Usage: {{ include "aisix-cloud.selectorLabels" (dict "root" . "component" "api") }} +Usage: {{ include "aisix-cp.selectorLabels" (dict "root" . "component" "api") }} */}} -{{- define "aisix-cloud.selectorLabels" -}} -app.kubernetes.io/name: {{ include "aisix-cloud.name" .root }} +{{- define "aisix-cp.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aisix-cp.name" .root }} app.kubernetes.io/instance: {{ .root.Release.Name }} app.kubernetes.io/component: {{ .component }} {{- end }} @@ -50,7 +50,7 @@ app.kubernetes.io/component: {{ .component }} {{/* PostgreSQL host — uses builtin subchart service name or external host. */}} -{{- define "aisix-cloud.pgHost" -}} +{{- define "aisix-cp.pgHost" -}} {{- if .Values.postgresql.builtin }} {{- if .Values.postgresql.fullnameOverride }} {{- .Values.postgresql.fullnameOverride }} @@ -65,7 +65,7 @@ PostgreSQL host — uses builtin subchart service name or external host. {{/* PostgreSQL port. */}} -{{- define "aisix-cloud.pgPort" -}} +{{- define "aisix-cp.pgPort" -}} {{- if .Values.postgresql.builtin }} {{- .Values.postgresql.primary.service.ports.postgresql }} {{- else }} @@ -76,7 +76,7 @@ PostgreSQL port. {{/* PostgreSQL username. */}} -{{- define "aisix-cloud.pgUser" -}} +{{- define "aisix-cp.pgUser" -}} {{- if .Values.postgresql.builtin }} {{- if .Values.postgresql.auth.usePostgresUserForAppConnections }} {{- "postgres" }} @@ -91,7 +91,7 @@ PostgreSQL username. {{/* PostgreSQL database name. */}} -{{- define "aisix-cloud.pgDatabase" -}} +{{- define "aisix-cp.pgDatabase" -}} {{- if .Values.postgresql.builtin }} {{- .Values.postgresql.auth.database }} {{- else }} @@ -102,7 +102,7 @@ PostgreSQL database name. {{/* PostgreSQL SSL mode. */}} -{{- define "aisix-cloud.pgSSLMode" -}} +{{- define "aisix-cp.pgSSLMode" -}} {{- if .Values.postgresql.builtin }} {{- "disable" }} {{- else }} @@ -114,21 +114,21 @@ PostgreSQL SSL mode. Database URL constructed from postgresql config. Uses $(PGPASSWORD) env var substitution for runtime secret injection. */}} -{{- define "aisix-cloud.databaseURL" -}} -postgres://{{ include "aisix-cloud.pgUser" . }}:$(PGPASSWORD)@{{ include "aisix-cloud.pgHost" . }}:{{ include "aisix-cloud.pgPort" . }}/{{ include "aisix-cloud.pgDatabase" . }}?sslmode={{ include "aisix-cloud.pgSSLMode" . }} +{{- define "aisix-cp.databaseURL" -}} +postgres://{{ include "aisix-cp.pgUser" . }}:$(PGPASSWORD)@{{ include "aisix-cp.pgHost" . }}:{{ include "aisix-cp.pgPort" . }}/{{ include "aisix-cp.pgDatabase" . }}?sslmode={{ include "aisix-cp.pgSSLMode" . }} {{- end }} {{/* -Secret name for aisix-cloud secrets. +Secret name for aisix-cp secrets. */}} -{{- define "aisix-cloud.secretName" -}} -{{ include "aisix-cloud.fullname" . }}-secrets +{{- define "aisix-cp.secretName" -}} +{{ include "aisix-cp.fullname" . }}-secrets {{- end }} {{/* Name of the Secret containing the PostgreSQL password. */}} -{{- define "aisix-cloud.pgSecretName" -}} +{{- define "aisix-cp.pgSecretName" -}} {{- if .Values.postgresql.builtin }} {{- if .Values.postgresql.auth.existingSecret }} {{- .Values.postgresql.auth.existingSecret }} @@ -140,14 +140,14 @@ Name of the Secret containing the PostgreSQL password. {{- else if .Values.externalDatabase.existingSecret }} {{- .Values.externalDatabase.existingSecret }} {{- else }} -{{- printf "%s-external-db" (include "aisix-cloud.fullname" .) }} +{{- printf "%s-external-db" (include "aisix-cp.fullname" .) }} {{- end }} {{- end }} {{/* Secret key containing the PostgreSQL password for application connections. */}} -{{- define "aisix-cloud.pgPasswordSecretKey" -}} +{{- define "aisix-cp.pgPasswordSecretKey" -}} {{- if and .Values.postgresql.builtin .Values.postgresql.auth.usePostgresUserForAppConnections }} {{- "postgres-password" }} {{- else }} @@ -158,9 +158,9 @@ Secret key containing the PostgreSQL password for application connections. {{/* ServiceAccount name. */}} -{{- define "aisix-cloud.serviceAccountName" -}} +{{- define "aisix-cp.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "aisix-cloud.fullname" .) .Values.serviceAccount.name }} +{{- default (include "aisix-cp.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} @@ -169,7 +169,7 @@ ServiceAccount name. {{/* Image pull secrets from global config. */}} -{{- define "aisix-cloud.imagePullSecrets" -}} +{{- define "aisix-cp.imagePullSecrets" -}} {{- with .Values.global.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 2 }} @@ -180,7 +180,7 @@ imagePullSecrets: Init container that blocks until PostgreSQL accepts connections. Reuses the same PG image shipped by the chart so no extra pull is needed. */}} -{{- define "aisix-cloud.pgWaitInitContainer" -}} +{{- define "aisix-cp.pgWaitInitContainer" -}} - name: wait-for-pg image: "{{ .Values.postgresql.image.registry }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}" imagePullPolicy: IfNotPresent @@ -188,13 +188,13 @@ Reuses the same PG image shipped by the chart so no extra pull is needed. - name: PGPASSWORD valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.pgSecretName" . }} - key: {{ include "aisix-cloud.pgPasswordSecretKey" . }} + name: {{ include "aisix-cp.pgSecretName" . }} + key: {{ include "aisix-cp.pgPasswordSecretKey" . }} command: - sh - -c - | - until pg_isready -h {{ include "aisix-cloud.pgHost" . }} -p {{ include "aisix-cloud.pgPort" . }} -U {{ include "aisix-cloud.pgUser" . }}; do + until pg_isready -h {{ include "aisix-cp.pgHost" . }} -p {{ include "aisix-cp.pgPort" . }} -U {{ include "aisix-cp.pgUser" . }}; do echo "waiting for postgresql..." sleep 2 done diff --git a/charts/aisix-cloud/templates/api-deployment.yaml b/charts/aisix-cp/templates/api-deployment.yaml similarity index 69% rename from charts/aisix-cloud/templates/api-deployment.yaml rename to charts/aisix-cp/templates/api-deployment.yaml index 788f34f..6013bf6 100644 --- a/charts/aisix-cloud/templates/api-deployment.yaml +++ b/charts/aisix-cp/templates/api-deployment.yaml @@ -1,29 +1,29 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "aisix-cloud.fullname" . }}-api + name: {{ include "aisix-cp.fullname" . }}-api labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "api") | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "api") | nindent 4 }} spec: replicas: {{ .Values.api.replicaCount }} selector: matchLabels: - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "api") | nindent 6 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "api") | nindent 6 }} template: metadata: labels: - {{- include "aisix-cloud.labels" . | nindent 8 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "api") | nindent 8 }} + {{- include "aisix-cp.labels" . | nindent 8 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "api") | nindent 8 }} spec: - {{- include "aisix-cloud.imagePullSecrets" . | nindent 6 }} - serviceAccountName: {{ include "aisix-cloud.serviceAccountName" . }} + {{- include "aisix-cp.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "aisix-cp.serviceAccountName" . }} {{- with .Values.api.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} initContainers: - {{- include "aisix-cloud.pgWaitInitContainer" . | nindent 8 }} + {{- include "aisix-cp.pgWaitInitContainer" . | nindent 8 }} containers: - name: api image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}" @@ -40,23 +40,23 @@ spec: - name: PGPASSWORD valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.pgSecretName" . }} - key: {{ include "aisix-cloud.pgPasswordSecretKey" . }} + name: {{ include "aisix-cp.pgSecretName" . }} + key: {{ include "aisix-cp.pgPasswordSecretKey" . }} - name: AISIX_CLOUD_LISTEN value: ":8080" - name: AISIX_CLOUD_DATABASE_URL - value: {{ include "aisix-cloud.databaseURL" . }} + value: {{ include "aisix-cp.databaseURL" . }} - name: AISIX_CLOUD_PUBLIC_BASE_URL value: {{ .Values.api.publicBaseURL | quote }} - name: AISIX_CLOUD_MASTER_KEY valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.secretName" . }} + name: {{ include "aisix-cp.secretName" . }} key: master-key - name: AISIX_CLOUD_MASTER_KEY_ID value: {{ .Values.secrets.masterKeyID | quote }} - name: AISIX_CLOUD_DASHBOARD_URL - value: "http://{{ include "aisix-cloud.fullname" . }}-ui:{{ .Values.ui.service.port }}" + value: "http://{{ include "aisix-cp.fullname" . }}-ui:{{ .Values.ui.service.port }}" {{- if .Values.api.dpmgrBaseURL }} - name: AISIX_CLOUD_DPMGR_BASE_URL value: {{ .Values.api.dpmgrBaseURL | quote }} @@ -64,7 +64,7 @@ spec: - name: AISIX_CLOUD_OAUTH_ENABLED value: {{ .Values.api.oauthEnabled | quote }} - name: AISIX_CLOUD_DP_IMAGE - value: {{ .Values.api.dpImage | default (printf "ghcr.io/api7/aisix:%s" .Chart.AppVersion) | quote }} + value: {{ .Values.api.dpImage | default (printf "docker.io/api7/aisix:%s" .Chart.AppVersion) | quote }} {{- with .Values.api.extraEnvVars }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/aisix-cp/templates/api-service.yaml b/charts/aisix-cp/templates/api-service.yaml new file mode 100644 index 0000000..eeff684 --- /dev/null +++ b/charts/aisix-cp/templates/api-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aisix-cp.fullname" . }}-api + labels: + {{- include "aisix-cp.labels" . | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "api") | nindent 4 }} +spec: + type: {{ .Values.api.service.type }} + ports: + - port: {{ .Values.api.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "api") | nindent 4 }} diff --git a/charts/aisix-cloud/templates/dpm-deployment.yaml b/charts/aisix-cp/templates/dpm-deployment.yaml similarity index 69% rename from charts/aisix-cloud/templates/dpm-deployment.yaml rename to charts/aisix-cp/templates/dpm-deployment.yaml index 75fbdc8..57a547c 100644 --- a/charts/aisix-cloud/templates/dpm-deployment.yaml +++ b/charts/aisix-cp/templates/dpm-deployment.yaml @@ -1,29 +1,29 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "aisix-cloud.fullname" . }}-dpm + name: {{ include "aisix-cp.fullname" . }}-dpm labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "dpm") | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "dpm") | nindent 4 }} spec: replicas: {{ .Values.dpm.replicaCount }} selector: matchLabels: - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "dpm") | nindent 6 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "dpm") | nindent 6 }} template: metadata: labels: - {{- include "aisix-cloud.labels" . | nindent 8 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "dpm") | nindent 8 }} + {{- include "aisix-cp.labels" . | nindent 8 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "dpm") | nindent 8 }} spec: - {{- include "aisix-cloud.imagePullSecrets" . | nindent 6 }} - serviceAccountName: {{ include "aisix-cloud.serviceAccountName" . }} + {{- include "aisix-cp.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "aisix-cp.serviceAccountName" . }} {{- with .Values.dpm.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} initContainers: - {{- include "aisix-cloud.pgWaitInitContainer" . | nindent 8 }} + {{- include "aisix-cp.pgWaitInitContainer" . | nindent 8 }} containers: - name: dpm image: "{{ .Values.dpm.image.repository }}:{{ .Values.dpm.image.tag | default .Chart.AppVersion }}" @@ -40,16 +40,16 @@ spec: - name: PGPASSWORD valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.pgSecretName" . }} - key: {{ include "aisix-cloud.pgPasswordSecretKey" . }} + name: {{ include "aisix-cp.pgSecretName" . }} + key: {{ include "aisix-cp.pgPasswordSecretKey" . }} - name: AISIX_DPMGR_LISTEN value: ":7944" - name: AISIX_DPMGR_DATABASE_URL - value: {{ include "aisix-cloud.databaseURL" . }} + value: {{ include "aisix-cp.databaseURL" . }} - name: AISIX_DPMGR_MASTER_KEY valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.secretName" . }} + name: {{ include "aisix-cp.secretName" . }} key: master-key - name: AISIX_DPMGR_MASTER_KEY_ID value: {{ .Values.secrets.masterKeyID | quote }} diff --git a/charts/aisix-cloud/templates/dpm-service.yaml b/charts/aisix-cp/templates/dpm-service.yaml similarity index 56% rename from charts/aisix-cloud/templates/dpm-service.yaml rename to charts/aisix-cp/templates/dpm-service.yaml index b3221ec..c6f6af6 100644 --- a/charts/aisix-cloud/templates/dpm-service.yaml +++ b/charts/aisix-cp/templates/dpm-service.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "aisix-cloud.fullname" . }}-dpm + name: {{ include "aisix-cp.fullname" . }}-dpm labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "dpm") | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "dpm") | nindent 4 }} spec: type: {{ .Values.dpm.service.type }} ports: @@ -16,4 +16,4 @@ spec: nodePort: {{ .Values.dpm.service.nodePort }} {{- end }} selector: - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "dpm") | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "dpm") | nindent 4 }} diff --git a/charts/aisix-cloud/templates/external-db-secret.yaml b/charts/aisix-cp/templates/external-db-secret.yaml similarity index 73% rename from charts/aisix-cloud/templates/external-db-secret.yaml rename to charts/aisix-cp/templates/external-db-secret.yaml index fb9088b..42ad606 100644 --- a/charts/aisix-cloud/templates/external-db-secret.yaml +++ b/charts/aisix-cp/templates/external-db-secret.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: Secret metadata: - name: {{ include "aisix-cloud.fullname" . }}-external-db + name: {{ include "aisix-cp.fullname" . }}-external-db labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} type: Opaque data: password: {{ required "externalDatabase.password is required when existingSecret is not set" .Values.externalDatabase.password | b64enc }} diff --git a/charts/aisix-cloud/templates/secret.yaml b/charts/aisix-cp/templates/secret.yaml similarity index 94% rename from charts/aisix-cloud/templates/secret.yaml rename to charts/aisix-cp/templates/secret.yaml index 00f5035..dcc3fd5 100644 --- a/charts/aisix-cloud/templates/secret.yaml +++ b/charts/aisix-cp/templates/secret.yaml @@ -26,9 +26,9 @@ password. Skipped when an existingSecret injects the credentials. apiVersion: v1 kind: Secret metadata: - name: {{ include "aisix-cloud.secretName" . }} + name: {{ include "aisix-cp.secretName" . }} labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} annotations: helm.sh/resource-policy: keep type: Opaque diff --git a/charts/aisix-cloud/templates/serviceaccount.yaml b/charts/aisix-cp/templates/serviceaccount.yaml similarity index 69% rename from charts/aisix-cloud/templates/serviceaccount.yaml rename to charts/aisix-cp/templates/serviceaccount.yaml index dda2447..9c34529 100644 --- a/charts/aisix-cloud/templates/serviceaccount.yaml +++ b/charts/aisix-cp/templates/serviceaccount.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "aisix-cloud.serviceAccountName" . }} + name: {{ include "aisix-cp.serviceAccountName" . }} labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/aisix-cloud/templates/ui-deployment.yaml b/charts/aisix-cp/templates/ui-deployment.yaml similarity index 71% rename from charts/aisix-cloud/templates/ui-deployment.yaml rename to charts/aisix-cp/templates/ui-deployment.yaml index a90c421..affacc1 100644 --- a/charts/aisix-cloud/templates/ui-deployment.yaml +++ b/charts/aisix-cp/templates/ui-deployment.yaml @@ -1,23 +1,23 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "aisix-cloud.fullname" . }}-ui + name: {{ include "aisix-cp.fullname" . }}-ui labels: - {{- include "aisix-cloud.labels" . | nindent 4 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "ui") | nindent 4 }} + {{- include "aisix-cp.labels" . | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "ui") | nindent 4 }} spec: replicas: {{ .Values.ui.replicaCount }} selector: matchLabels: - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "ui") | nindent 6 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "ui") | nindent 6 }} template: metadata: labels: - {{- include "aisix-cloud.labels" . | nindent 8 }} - {{- include "aisix-cloud.selectorLabels" (dict "root" . "component" "ui") | nindent 8 }} + {{- include "aisix-cp.labels" . | nindent 8 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "ui") | nindent 8 }} spec: - {{- include "aisix-cloud.imagePullSecrets" . | nindent 6 }} - serviceAccountName: {{ include "aisix-cloud.serviceAccountName" . }} + {{- include "aisix-cp.imagePullSecrets" . | nindent 6 }} + serviceAccountName: {{ include "aisix-cp.serviceAccountName" . }} {{- with .Values.ui.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} @@ -38,17 +38,17 @@ spec: - name: PGPASSWORD valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.pgSecretName" . }} - key: {{ include "aisix-cloud.pgPasswordSecretKey" . }} + name: {{ include "aisix-cp.pgSecretName" . }} + key: {{ include "aisix-cp.pgPasswordSecretKey" . }} - name: BETTER_AUTH_URL value: {{ .Values.api.publicBaseURL | quote }} - name: BETTER_AUTH_SECRET valueFrom: secretKeyRef: - name: {{ include "aisix-cloud.secretName" . }} + name: {{ include "aisix-cp.secretName" . }} key: better-auth-secret - name: AISIX_CLOUD_DATABASE_URL - value: {{ include "aisix-cloud.databaseURL" . }} + value: {{ include "aisix-cp.databaseURL" . }} - name: AISIX_DASHBOARD_LOCALE value: {{ .Values.ui.defaultLocale | quote }} {{- with .Values.ui.extraEnvVars }} diff --git a/charts/aisix-cp/templates/ui-service.yaml b/charts/aisix-cp/templates/ui-service.yaml new file mode 100644 index 0000000..1373793 --- /dev/null +++ b/charts/aisix-cp/templates/ui-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aisix-cp.fullname" . }}-ui + labels: + {{- include "aisix-cp.labels" . | nindent 4 }} + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "ui") | nindent 4 }} +spec: + type: {{ .Values.ui.service.type }} + ports: + - port: {{ .Values.ui.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "aisix-cp.selectorLabels" (dict "root" . "component" "ui") | nindent 4 }} diff --git a/charts/aisix-cloud/values.yaml b/charts/aisix-cp/values.yaml similarity index 92% rename from charts/aisix-cloud/values.yaml rename to charts/aisix-cp/values.yaml index 82d6567..7cf1ae5 100644 --- a/charts/aisix-cloud/values.yaml +++ b/charts/aisix-cp/values.yaml @@ -7,7 +7,7 @@ global: api: replicaCount: 1 image: - repository: ghcr.io/api7/aisix-cp-api + repository: docker.io/api7/aisix-cp-api pullPolicy: IfNotPresent tag: "" # empty -> .Chart.AppVersion service: @@ -40,13 +40,13 @@ api: publicBaseURL: "http://localhost:8080" dpmgrBaseURL: "" oauthEnabled: false - dpImage: "" # empty -> ghcr.io/api7/aisix: + dpImage: "" # empty -> docker.io/api7/aisix: ## @section dp-manager dpm: replicaCount: 1 image: - repository: ghcr.io/api7/aisix-cp-dpm + repository: docker.io/api7/aisix-cp-dpm pullPolicy: IfNotPresent tag: "" # empty -> .Chart.AppVersion service: @@ -86,7 +86,7 @@ ui: # locale (default English). Read server-side at request time. defaultLocale: "en" image: - repository: ghcr.io/api7/aisix-cp-ui + repository: docker.io/api7/aisix-cp-ui pullPolicy: IfNotPresent tag: "" # empty -> .Chart.AppVersion service: @@ -166,8 +166,10 @@ postgresql: ## If left as default, the password is baked into the PG data volume on first init ## and must remain unchanged across re-deploys. ## The chart REJECTS the default 'changeme' at render/install time when - ## postgresql.builtin=true — set a real password (openssl rand -base64 24) - ## or use existingSecret above. + ## postgresql.builtin=true — set a real password (openssl rand -hex 24). + ## Use a URL-safe value: the password is embedded in a postgres:// DSN, + ## so + / = (as produced by `openssl rand -base64`) corrupt URL parsing. + ## Or use existingSecret above. password: changeme postgresPassword: changeme database: aisix_cloud