Closed matti closed 2 years ago
The work-around is to adjust the service after first deployment:
gcloud run services update http-doom --max-instances 1
The ongoing fix would be to add max-instances
as an option. But, there are a number of other configuration updates in Cloud Run that should be assessed if they are useful to add to Cloud Run Button.
FYI @matti I tried to update your repo to Caddy 2, but encountered issues trying to update the cgi settings your app relies on.
I ended up using a custom app.json
in my testing where I skip building, and instead pulling the image you prepared earlier. Using the executable built from #228, this deployed successfully.
...
"hooks": {
"prebuild": {
"commands": [
"./build.sh"
]
}
}
...
https://github.com/glasnt/crb-appjson-test/blob/a9327af1fe39905910a562ce9606e116389e15bf/build.sh#L1
DOOM_IMAGE=mattipaksula/http-doom
echo "Copying $DOOM_IMAGE to local project as $IMAGE_URL"
docker pull $DOOM_IMAGE
docker tag $DOOM_IMAGE $IMAGE_URL
Nice work @glasnt! You could probably use a postcreate
hook to set the additional config. Use the GOOGLE_CLOUD_PROJECT
, GOOGLE_CLOUD_REGION
, and K_SERVICE
env vars.
@jamesward just so.
@matti You'd want to add a postcreate
script as James mentioned that runs: gcloud run services update $K_SERVICE --region $GOOGLE_CLOUD_REGION --platform managed --max-instances 1
as a temporary workaround.
nah, this http-doom is a joke anyway. BUT, it is a valid usecase to deploy apps with 1 instance with the button
how to set the number of instances to only 1 for apps that don't work when scaled, eg: https://github.com/matti/http-doom/
https://github.com/matti/http-doom/issues/6