google-cloud-platformcontainersgoogle-cloud-run

Configure uptime check via trigger cloudbuild YAML


enter image description here

I'm trying to set this up during my deploy YAML (inline in the trigger). I can't find the right command to run

I tried the gcloud.run.services.update, but it errors with "unrecognized arguments"

  --health-check-http-path=/healthz

Complete step:

- name: gcr.io/google.com/cloudsdktool/cloud-sdk
args:
  - run
  - services
  - update
  - $_SERVICE_NAME
  - --startup-delay=60s
  - --health-check-http-path=/healthz
entrypoint: gcloud
id: Configure Startup Probe

What I was able to do, is configuring the custom probe in the service settings.

But even with service update I still get unrecognized arguments error. From the docs deploy and update service syntaxes look substantially the same.


Solution

  • I confirm the route is the one proposed by dany L

    - name: gcr.io/google.com/cloudsdktool/cloud-sdk
        args:
          - '-c'
          - |
            if [ -f /workspace/service.yaml ]; then
              echo ">>> Updating service with new probe path..."
              gcloud beta run services replace /workspace/service.yaml --region=europe-west3 --platform=managed
            else
              echo ">>> ERRORE: service.yaml not found!"
              exit 1
            fi
        id: Apply Probe Path Update
        entrypoint: bash
    

    Of course this means parsing the yaml content and changing the parts that you want to update. For me this is far from ideal, but for now it'll do.