Test API Communication
Purpose: API가 Kong API Gateway에 제대로 배포되고 정상적으로 작동하는지 확인하기 위한 내부 테스트 방법
Explanation:
- 외부 호출 API URL이 https://domain.com/basePath/apiPath인 경우, 다음 구성의 조합입니다:
- 프로토콜: HTTPS
- 호스트: domain.com
- 기본 경로: /basePath
- 하위 경로: /apiPath
- 외부 도메인이 DNS 서버에 등록되지 않았거나 잘못된 경우.
- BasePath가 잘못된 경우.
{
message: "no Route matched with those values"
}
- 백엔드 URL이 잘못된 경우.
{
message: "name resolution failed"
}
- 백엔드 애플리케이션이 정상적으로 시작되지 않는 경우.
{
message: "An invalid response was received from the upstream server"
}
- 기타 맥락: 웹 브라우저 > 개발자 도구 확인
- API가 Kong API Gateway에 성공적으로 배포되었는지 확인하는 방법
# Kong API Gateway에 접근하기 (같은 클러스터에서 실행 중인 모든 포드가 접근할 수 있으며 curl을 지원합니다)
kubectl -n apim-dev exec --it {gateway pod name} -c fluent-bit /bin/bash
# Kong API Gateway API 프록시의 포트 80에서 유효성을 검사하기 위해 기본 경로, 하위 경로 입력
# 헤더 호스트에 실제 비즈니스 도메인 입력
# 실제 비즈니스 도메인과 통신하는 것처럼 테스트하는 방법
curl -i -k http://{Kong-Service-Name}.{Kong-Namespace}:80/basePath/apiPath -H "Host: domain.com"