Merge pull request #147 from svc-design/codex/fix-offline-setup-for-apisix-gateway-s1v6fh

feat: add apisix offline package workflow
This commit is contained in:
shenlan 2025-09-14 19:54:11 +08:00 committed by GitHub
commit fc1402dc7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 47 additions and 8 deletions

View File

@ -3,7 +3,7 @@ name: Build Offline APISIX Gateway Installer
on:
push:
paths:
- 'gitops/scripts/kong-gateway/deploy-kong-gateway.sh'
- 'gitops/scripts/apisix-gateway/deploy-apisix-gateway.sh'
- '.github/workflows/offline-package-apisix-gateway.yaml'
workflow_dispatch:
inputs:
@ -12,7 +12,7 @@ on:
required: false
type: string
chart_version:
description: "Override helm chart version for kong/ingress (e.g., 1.2.3). Leave empty to auto-resolve"
description: "Override helm chart version for apisix (e.g., 1.2.3). Leave empty to auto-resolve"
required: false
type: string
@ -45,7 +45,7 @@ jobs:
- name: Add helm repo
run: |
set -euo pipefail
helm repo add kong https://charts.konghq.com
helm repo add apisix https://charts.apiseven.com
helm repo update
- name: Resolve latest chart version
@ -57,7 +57,7 @@ jobs:
if [ -n "${OVERRIDE_CHART_VERSION}" ]; then
CHART_VERSION="${OVERRIDE_CHART_VERSION}"
else
CHART_VERSION=$(helm search repo kong/ingress --versions | awk 'NR==2{print $2}')
CHART_VERSION=$(helm search repo apisix/apisix --versions | awk 'NR==2{print $2}')
fi
echo "chart_version=${CHART_VERSION}" >> "$GITHUB_OUTPUT"
@ -76,7 +76,7 @@ jobs:
CHART_VERSION: ${{ steps.resolve.outputs.chart_version }}
run: |
set -euo pipefail
helm template kong kong/ingress --version "${CHART_VERSION}" > manifest.yaml
helm template apisix apisix/apisix --version "${CHART_VERSION}" > manifest.yaml
images=$(grep -oP 'image:\s*\K[^\s]+' manifest.yaml | sort -u)
for img in $images; do
docker pull "$img"
@ -84,18 +84,18 @@ jobs:
docker save "$img" -o offline-installer/images/${safe}.tar
done
- name: Download Helm chart (kong/ingress ${{ steps.resolve.outputs.chart_version }})
- name: Download Helm chart (apisix/apisix ${{ steps.resolve.outputs.chart_version }})
env:
CHART_VERSION: ${{ steps.resolve.outputs.chart_version }}
run: |
set -euo pipefail
helm pull kong/ingress --version="${CHART_VERSION}" --untar --untardir offline-installer/charts
helm pull apisix/apisix --version="${CHART_VERSION}" --untar --untardir offline-installer/charts
- name: Stage deployment script
run: |
set -euo pipefail
mkdir -p offline-installer/scripts
cp gitops/scripts/kong-gateway/deploy-kong-gateway.sh offline-installer/scripts/
cp gitops/scripts/apisix-gateway/deploy-apisix-gateway.sh offline-installer/scripts/
- name: Pack offline installer
run: |

View File

@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail
ingress_ip=$1
cat > values.yaml <<EOF
service:
type: NodePort
externalIPs:
- $ingress_ip
http:
enabled: true
servicePort: 80
tls:
servicePort: 443
nodePort: 443
apisix:
ssl:
enabled: true
prometheus:
enabled: true
ingress-controller:
enabled: true
config:
apisix:
serviceNamespace: "ingress"
kubernetes:
enableGatewayAPI: true
metrics:
serviceMonitor:
enabled: true
namespace: "ingress"
EOF
helm repo add apisix https://charts.apiseven.com || echo true
helm repo update
kubectl create ns ingress || echo true
helm delete nginx -n ingress || echo true
helm upgrade --install apisix apisix/apisix --namespace ingress -f values.yaml