Refactor Helm chart for API7EE: clarify gateway requirements, improve
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 31s
Build and Deploy / build-api (push) Successful in 1m14s
Build and Deploy / build-web (push) Successful in 1m36s

ADC config templating, and enhance gateway health checks
This commit is contained in:
d.viti
2025-10-08 13:44:01 +02:00
parent c0832ff59b
commit b2e0d5bd10
4 changed files with 106 additions and 21 deletions

View File

@@ -63,13 +63,26 @@ spec:
echo "Waiting for API7 Gateway to be available..."
MAX_RETRIES=30
RETRY_COUNT=0
{{- if eq .Values.api7.backend "api7ee" }}
# For API7 EE, check the version endpoint
HEALTH_ENDPOINT="${API7_ADMIN_URL}/version"
{{- else }}
# For Apache APISIX, check the admin routes endpoint
HEALTH_ENDPOINT="${API7_ADMIN_URL}/apisix/admin/routes"
{{- end }}
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if curl -s -o /dev/null -w "%{http_code}" ${API7_ADMIN_URL}/apisix/admin/routes \
-H "X-API-KEY: ${API7_ADMIN_KEY}" | grep -q "200\|401"; then
echo "API7 Gateway is ready!"
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" ${HEALTH_ENDPOINT} \
{{- if eq .Values.api7.backend "apisix" }}
-H "X-API-KEY: ${API7_ADMIN_KEY}" \
{{- end }}
--max-time 5 || echo "000")
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "401" ]; then
echo "API7 Gateway is ready! (HTTP $HTTP_CODE)"
break
fi
echo "API7 Gateway not ready, retrying... ($RETRY_COUNT/$MAX_RETRIES)"
echo "API7 Gateway not ready (HTTP $HTTP_CODE), retrying... ($RETRY_COUNT/$MAX_RETRIES)"
RETRY_COUNT=$((RETRY_COUNT + 1))
sleep 10
done
@@ -209,4 +222,4 @@ spec:
secret:
secretName: {{ .Values.api7.tls.secretName | default (printf "%s-tls" (include "api7ee.fullname" .)) }}
{{- end }}
{{- end }}
{{- end }}