Switching from GKE to Cloud Run - best practices for healthcheck, liveness, readiness and general monitoring

Viewed 223

I'm looking towards switching some microservices from GKE to Cloud Run but I'm not able to find out anything related to the healthcheck, liveness, readiness and general monitoring when it goes how it is getting handled when deployed to GKE.

I assume that healthcheck and liveness is possible only when container was deployed to the Cloud Run but it will not be available when service is scaled down to 0. At that time in the monitoring I will get that service is down.

So my question is what are the best practices to handle them for the Cloud Run?

1 Answers

I will attempt to answer your points one at a time

  • Readiness and liveness probes. Cloud Run deploys a LoadBalancer in front of your Service and handles TLS termination for you. Cloud Run expects your container to be available (aka listening on 0.0.0.0 on the defined port) within 4 minutes of its being deployed, otherwise, it considers it down and tries to restart it.
  • Cloud Run has built-in monitoring and alerting if you are using Cloud Ops you don't have to do anything.
  • You can ensure your Service will not trigger a false positive by setting the min replicas to 1 ensuring there is always at least 1 replicas of your service available

Let me know if there something you want to clarify

Related