簡體   English   中英

開始使用 Google Cloud Kubernetes 集群后,Cloud Build 無法部署 Cloud Run

[英]Cloud Build fails to deploy Cloud Run after started using Google Cloud Kubernetes Cluster

我一直在使用帶有免費試用帳戶的 Google Cloud。

我能夠從我的 Github 存儲庫部署 Cloud Run 構建。 但是,由於我開始在 Google Compute Engine 中使用 2 個 VM 使用 Google Cloud Kubernetes 集群和作業,因此 Cloud Run 部署開始失敗:

Step #2 - "Deploy": gcr.io/google.com/cloudsdktool/cloud-sdk:slim
Step #2 - "Deploy": Deploying...
Step #2 - "Deploy": failed
Step #2 - "Deploy": Deployment failed
Step #2 - "Deploy": ERROR: (gcloud.run.services.update) spec.template.spec.containers[0].resources.limits.cpu: Invalid value specified for cpu. For the specified value, maxScale may not exceed 30.
Step #2 - "Deploy": Consider running your workload in a region with greater capacity, decreasing your requested cpu-per-instance, or requesting an increase in quota for this region if you are seeing sustained usage near this limit, see https://cloud.google.com/run/quotas. Your project may gain access to further scaling by adding billing information to your account.
Finished Step #2 - "Deploy"
ERROR
ERROR: build step 2 "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" failed: step exited with non-zero status: 1

在此處輸入圖像描述

成功的 Cloud Run 部署需要多少 CPU? 這是 Inline Cloud Run 部署 yaml 文件:

steps:
  - name: gcr.io/k8s-skaffold/pack
    env:
      - GOOGLE_ENTRYPOINT=$_ENTRYPOINT
    args:
      - build
      - '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
      - '--builder=gcr.io/buildpacks/builder:v1'
      - '--network=cloudbuild'
      - '--path=.'
      - '--env=GOOGLE_ENTRYPOINT'
    id: Buildpack
    entrypoint: pack
  - name: gcr.io/cloud-builders/docker
    args:
      - push
      - '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
    id: Push
  - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:slim'
    args:
      - run
      - services
      - update
      - $_SERVICE_NAME
      - '--platform=managed'
      - '--image=$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
      - >-
        --labels=managed-by=gcp-cloud-build-deploy-cloud-run,commit-sha=$COMMIT_SHA,gcb-build-id=$BUILD_ID,gcb-trigger-id=$_TRIGGER_ID,$_LABELS
      - '--region=$_DEPLOY_REGION'
      - '--quiet'
    id: Deploy
    entrypoint: gcloud
images:
  - '$_GCR_HOSTNAME/$PROJECT_ID/$REPO_NAME/$_SERVICE_NAME:$COMMIT_SHA'
options:
  substitutionOption: ALLOW_LOOSE
substitutions:
  _LABELS: gcb-trigger-id=xxxxxx-d5fd-47b7-8949-xxxxxxxxxx
  _TRIGGER_ID: xxxxxx-d5fd-47b7-8949-xxxxxxxxxx
  _DEPLOY_REGION: europe-west1
  _GCR_HOSTNAME: eu.gcr.io
  _PLATFORM: managed
  _SERVICE_NAME: videoo-app-dev
  _ENTRYPOINT: 'gunicorn -b :$PORT videoo.wsgi'
tags:
  - gcp-cloud-build-deploy-cloud-run
  - gcp-cloud-build-deploy-cloud-run-managed
  - videoo-app-devs

恢復成功部署的方法應該是什么?

只需 go 到雲運行頁面:單擊編輯並部署新版本。 現在只需將自動縮放減少到 30 或 50,允許的最大實例數將在錯誤中提及。

我昨天有同樣的問題。

添加你的參數

--max-instances=29

或任何少於 30 的金額

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM