okonomi / cloudrun-healthcheck-sample

cloudrun-healthcheck-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloud Run health check sample

https://cloud.google.com/run/docs/configuring/healthchecks

build:

docker buildx build \
  --platform linux/amd64 \
  -t asia-northeast1-docker.pkg.dev/cloudrun-healthcheck-sample/cloudrun-healthcheck-sample/hello:latest \
  .

push:

docker push asia-northeast1-docker.pkg.dev/cloudrun-healthcheck-sample/cloudrun-healthcheck-sample/hello:latest

deploy:

gcloud run deploy hello \
  --image asia-northeast1-docker.pkg.dev/cloudrun-healthcheck-sample/cloudrun-healthcheck-sample/hello:latest \
  --allow-unauthenticated

export:

gcloud beta run services describe hello --format export > service.yaml

update YAML:

spec:
  template:
    metadata:
    spec:
      containers:
        image: IMAGE_URL
        startupProbe:
          httpGet:
            path: /health
          initialDelaySeconds: 10
          timeoutSeconds: 1
          failureThreshold: 30
          periodSeconds: 5

replace:

gcloud run services replace service.yaml

About

cloudrun-healthcheck-sample


Languages

Language:Ruby 77.5%Language:Dockerfile 15.1%Language:Procfile 7.4%