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"