I am using ESP to verify API keys for services implemented in a container. Before adding ESP, the service runs in its own container with health check available at url /healthz. The deployment is exposed in a service of type NodePort, which is in turn exposed via an ingress.
After adding the ESP to the pod, I noticed that the health check is failing with the following from the logs:
14:57:49.666
us-central1-a404Endpoints management skipped for an unrecognized HTTP call: GET /healthz
{ insertId: "4b2e2341-8af5-4124-9fcd-d77c11a448a0@a1"
jsonPayload: { error_cause: "service_control"
http_method: "GET"
http_response_code: 404
location: "us-central1-a"
log_message: "Endpoints management skipped for an unrecognized HTTP call: GET /healthz"
producer_project_id: "cds-dev-155819"
request_latency_in_ms: 0
request_size_in_bytes: 94
response_size_in_bytes: 362
timestamp: 1500321469.666007
url: "/healthz"
} receiveTimestamp: "2017-07-17T19:57:56.909827222Z"
When this is happening I had the following in swagger.yaml.
# basePath prefixes all resource paths
basePath: /v1
# Default to route all calls such as /docs and /healthz
x-google-allow: all
I tried adding "/healthz" to swagger.yaml and that solved the problem, which means that setting "x-google-allow" to "all" isn't doing what it was supposed to do. After changing the basePath to "/", I am getting the normal health check responses from the log file.
15:13:14.971
us-central1-a2001 msMethod: 0.ees_api_endpoints_cds_dev_155819_cloud_goog.Google_Autogenerated_Unrecognized_Get_Method_Call
{ insertId: "28ae159c-e2e8-4719-99c2-78c8f7d71596@a3"
jsonPayload: { api_method: "0.ees_api_endpoints_cds_dev_155819_cloud_goog.Google_Autogenerated_Unrecognized_Get_Method_Call"
api_name: "0.ees_api_endpoints_cds_dev_155819_cloud_goog"
api_version: "0.0.1"
http_method: "GET"
http_response_code: 200
location: "us-central1-a"
log_message: "Method: 0.ees_api_endpoints_cds_dev_155819_cloud_goog.Google_Autogenerated_Unrecognized_Get_Method_Call"
producer_project_id: "cds-dev-155819"
request_latency_in_ms: 1
request_size_in_bytes: 94
response_size_in_bytes: 220
timestamp: 1500322394.971024
url: "/healthz"
} receiveTimestamp: "2017-07-17T20:13:21.272287004Z"
Now my swagger.yaml looks like the following:
# basePath prefixes all resource paths
basePath: /
# Default to route all calls such as /docs and /healthz
x-google-allow: all
Apparently having "/v1" in the basePath changes how ESP's interpretation of "x-google-allow".
It's really annoying not being able to define a basePath in swagger. Could you please investigate and see if there is indeed an implementation issue between "basePath" and "x-google-allow"?
Thanks.
AL