我已经在jinja和yaml中创建了具有与here相同结构的Deployment Manager模板。我已经将自己的配置添加到jinja文件中,当我尝试部署yaml文件时,它会导致错误,如下所述。
C:\Users\xx\AppData\Local\Google\Cloud SDK> gcloud deployment-manager deployments create server --config C:\xx\version.yaml
The fingerprint of the deployment is vH6W0m1iIPzinLcOVvjgCA==
Waiting for create [operation-1556776293108-587e139f20bfe-e7c6a15b-221c9ec0]...failed.
ERROR: (gcloud.deployment-manager.deployments.create) Error in Operation [operation-1556776293108-587e139f20bfe-e7c6a15b-221c9ec0]: errors:
- code: ERROR_PROCESSING_REQUEST
message: 'Unreachable URL https://appengine.googleapis.com/v1/apps/[project_id]/services/default/versions,
reason: UNREACHABLE_5xx, code: 500'
打开网址https://appengine.googleapis.com/v1/apps/[project_id]/services/default/versions
时出现以下错误:
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
要创建OAuth 2令牌,我遵循了here所述的步骤。 首先,我尝试部署有效的示例hello world应用程序。 然后,我将version.jinja文件转换为用于部署的json文件,并在使用此命令部署应用程序时将其转换为
curl -X POST -T "app.json" -H "Content-Type: application/json" -H "Authorization: Bearer [MY_ACCESS_TOKEN]" https://appengine.googleapis.com/v1/apps/[MY_PROJECT_ID]/services/default/versions
执行此操作会给我以下错误:
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
问题:
1。。如何配置授权?是否需要提供任何IAM角色?
2。。如何使用Deployment Manager自动创建vpc和子网,以便在这些子网中启动应用程序的服务器实例。