Refactor Helm chart for API7EE: clarify gateway requirements, improve
ADC config templating, and enhance gateway health checks
This commit is contained in:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user