Сокращение запросов API для служб облачного запуска с помощью Anthos Config Management
В настоящее время я предоставляю услуги GCP Cloud Run с помощью Anthos Config Management. В журналах я заметил, что в секунду происходит три попытки получить информацию о сервисе из API Cloud Run (Cloud RunGetService). Участником, связанным с этими запросами, является учетная запись, связанная с соединителем конфигурации.
Я несколько раз сталкивался с ошибками ограничения квот из-за высокой частоты таких запросов. Мне интересно узнать причины этих многочисленных попыток, и я хотел бы знать, есть ли способ уменьшить количество запросов к API.
Мы будем очень признательны за вашу помощь и рекомендации по этому вопросу.
Краткое содержание:
2023-04-07T09:29:53.637281Z - google.cloud.run.v2.Services.GetService
2023-04-07T09:29:53.544169Z - google.cloud.run.v2.Services.GetService
2023-04-07T09:29:52.487437Z - google.cloud.run.v2.Services.GetService
2023-04-07T09:29:51.521130Z - google.cloud.run.v2.Services.GetService
2023-04-07T09:29:51.482940Z - google.cloud.run.v2.Services.GetService
2023-04-07T09:29:51.440035Z - google.cloud.run.v2.Services.GetService
[
{
"insertId": "6o7xwnd1apc",
"logName": "projects/projectId/logs/cloudaudit.googleapis.com%2Fdata_access",
"protoPayload": {
"@type": "type.googleapis.com/google.cloud.audit.AuditLog",
"authenticationInfo": {
"principalEmail": "anthos-config-managment-service-account",
"principalSubject": "serviceAccount:anthos-config-managment-service-account"
},
"authorizationInfo": [
{
"granted": true,
"permission": "run.services.get",
"resource": "projects/projectId/locations/region/services/serviceName",
"resourceAttributes": {}
}
],
"methodName": "google.cloud.run.v2.Services.GetService",
"requestMetadata": {
"callerIp": "10.156.0.8",
"callerNetwork": "//compute.googleapis.com/projects/projectId/global/networks/__unknown__",
"callerSuppliedUserAgent": "kcc/controller-manager blueprints/kpt-pkg-fn-live DeclarativeClientLib/0.0.1,gzip(gfe),gzip(gfe)",
"destinationAttributes": {},
"requestAttributes": {
"auth": {},
"time": "2023-04-07T09:29:53.658779Z"
}
},
"resourceLocation": {
"currentLocations": ["region"]
},
"resourceName": "projects/projectId/locations/region/services/serviceName",
"serviceName": "run.googleapis.com"
},
"receiveTimestamp": "2023-04-07T09:29:54.442225196Z",
"resource": {
"labels": {
"configuration_name": "",
"location": "region",
"project_id": "projectId",
"revision_name": "",
"service_name": "serviceName"
},
"type": "cloud_run_revision"
},
"severity": "INFO",
"timestamp": "2023-04-07T09:29:53.637281Z"
},
{
"insertId": "y4uoutd1cbh",
"logName": "projects/projectId/logs/cloudaudit.googleapis.com%2Fdata_access",
"protoPayload": {
"@type": "type.googleapis.com/google.cloud.audit.AuditLog",
"authenticationInfo": {
"principalEmail": "anthos-config-managment-service-account",
"principalSubject": "serviceAccount:anthos-config-managment-service-account"
},
"authorizationInfo": [
{
"granted": true,
"permission": "run.services.get",
"resource": "projects/projectId/locations/region/services/serviceName",
"resourceAttributes": {}
}
],
"methodName": "google.cloud.run.v2.Services.GetService",
"requestMetadata": {
"callerIp": "10.156.0.8",
"callerNetwork": "//compute.googleapis.com/projects/projectId/global/networks/__unknown__",
"callerSuppliedUserAgent": "kcc/controller-manager blueprints/kpt-pkg-fn-live DeclarativeClientLib/0.0.1,gzip(gfe),gzip(gfe)",
"destinationAttributes": {},
"requestAttributes": {
"auth": {},
"time": "2023-04-07T09:29:53.561641Z"
}
},
"resourceLocation": {
"currentLocations": ["region"]
},
"resourceName": "projects/projectId/locations/region/services/serviceName",
"serviceName": "run.googleapis.com"
},
"receiveTimestamp": "2023-04-07T09:29:54.124104694Z",
"resource": {
"labels": {
"configuration_name": "",
"location": "region",
"project_id": "projectId",
"revision_name": "",
"service_name": "serviceName"
},
"type": "cloud_run_revision"
},
"severity": "INFO",
"timestamp": "2023-04-07T09:29:53.544169Z"
},
{
"insertId": "170bquhc1db",
"logName": "projects/projectId/logs/cloudaudit.googleapis.com%2Fdata_access",
"protoPayload": {
"@type": "type.googleapis.com/google.cloud.audit.AuditLog",
"authenticationInfo": {
"principalEmail": "anthos-config-managment-service-account",
"principalSubject": "serviceAccount:anthos-config-managment-service-account"
},
"authorizationInfo": [
{
"granted": true,
"permission": "run.services.get",
"resource": "projects/projectId/locations/region/services/serviceName",
"resourceAttributes": {}
}
],
"methodName": "google.cloud.run.v2.Services.GetService",
"requestMetadata": {
"callerIp": "10.156.0.8",
"callerNetwork": "//compute.googleapis.com/projects/projectId/global/networks/__unknown__",
"callerSuppliedUserAgent": "kcc/controller-manager blueprints/kpt-pkg-fn-live DeclarativeClientLib/0.0.1,gzip(gfe),gzip(gfe)",
"destinationAttributes": {},
"requestAttributes": {
"auth": {},
"time": "2023-04-07T09:29:52.504497Z"
}
},
"resourceLocation": {
"currentLocations": ["region"]
},
"resourceName": "projects/projectId/locations/region/services/serviceName",
"serviceName": "run.googleapis.com"
},
"receiveTimestamp": "2023-04-07T09:29:53.491235721Z",
"resource": {
"labels": {
"configuration_name": "",
"location": "region",
"project_id": "projectId",
"revision_name": "",
"service_name": "serviceName"
},
"type": "cloud_run_revision"
},
"severity": "INFO",
"timestamp": "2023-04-07T09:29:52.487437Z"
}]