From 45f2945ddef6832f2ddb07195208d1e805885b9e Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Thu, 2 Apr 2026 16:04:34 +0800 Subject: [PATCH] fix(charts): run apisix in standalone yaml mode --- oci/charts/infra/platform/k3s/Chart.yaml | 2 +- .../k3s/templates/apisix-helmrelease.yaml | 18 ++++++++++ oci/charts/infra/platform/k3s/values.yaml | 34 ++++++++++++++++--- 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/oci/charts/infra/platform/k3s/Chart.yaml b/oci/charts/infra/platform/k3s/Chart.yaml index 11e6923..f4010b3 100644 --- a/oci/charts/infra/platform/k3s/Chart.yaml +++ b/oci/charts/infra/platform/k3s/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: k3s-platform-chart description: Composes Flux-managed platform components for the k3s platform type: application -version: 0.1.0 +version: 0.1.1 appVersion: "1.0.0" diff --git a/oci/charts/infra/platform/k3s/templates/apisix-helmrelease.yaml b/oci/charts/infra/platform/k3s/templates/apisix-helmrelease.yaml index c564dfc..a75d92a 100644 --- a/oci/charts/infra/platform/k3s/templates/apisix-helmrelease.yaml +++ b/oci/charts/infra/platform/k3s/templates/apisix-helmrelease.yaml @@ -21,6 +21,24 @@ spec: upgrade: remediation: retries: 3 + postRenderers: + - kustomize: + patches: + - target: + group: apps + version: v1 + kind: Deployment + name: {{ .Values.components.apisix.releaseName }} + patch: | + - op: replace + path: /spec/template/spec/containers/0/command + value: + - sh + - -c + - | + export APISIX_STAND_ALONE=true + ln -sf /apisix-config/apisix.yaml /usr/local/apisix/conf/apisix.yaml + exec /docker-entrypoint.sh docker-start values: {{- toYaml .Values.components.apisix.values | nindent 4 }} {{- end }} diff --git a/oci/charts/infra/platform/k3s/values.yaml b/oci/charts/infra/platform/k3s/values.yaml index c7aea93..adf67c7 100644 --- a/oci/charts/infra/platform/k3s/values.yaml +++ b/oci/charts/infra/platform/k3s/values.yaml @@ -40,16 +40,40 @@ components: dashboard: enabled: false gateway: + enabled: true type: ClusterIP + control: + enabled: false apisix: deployment: + mode: standalone role: traditional - roleTraditional: - configProvider: yaml - standalone: - enabled: true + role_traditional: + config_provider: yaml + standalone: + config: | + routes: + - id: 1 + uri: "/*" + hosts: + - api.svc.plus + name: api-gateway-prod + upstream: + type: roundrobin + nodes: + "accounts.core-prod.svc.cluster.local:80": 1 + - id: 2 + uri: "/*" + hosts: + - api-pre.svc.plus + name: api-gateway-pre + upstream: + type: roundrobin + nodes: + "accounts.core-pre.svc.cluster.local:80": 1 + #END admin: - enabled: false + enabled: true vault: enabled: true releaseName: vault