What's the ideal way to set up multiple environments (eg. dev, stage and prod) for Google Cloud Run applications? [closed]
S

1

9

I've got a sample app up and running on Google Cloud Run, complete with CD from GitHub using Cloud Build et al. I would like to have different branches deploy to different environments (dev, stage prod, etc.), however the documentation doesn't hint at any sort of setup like this.

The simplest way I can think of would be to set up separate Cloud Runs with Cloud Build triggers on different branch RegExes, but I'm wondering if there is a more elegant solution as this still feels like a very "manual" method of achieving what I want.

I found one answer (How to get Cloud Run to handle multiple simultaneous deployments?) which confirms that this is a practice that has been followed, but I just want to confirm if that's indeed the best way or if there's anything better provided by GCP for this purpose.

I'm new to Google Cloud Run as well as the overall Google Cloud Platform in general.

Spiraea answered 22/8, 2020 at 16:19 Comment(2)
This depends on what you want to accomplish. Typically, Dev, Staging, Production are separate projects with their own resources. This is for authorization, separation and security. Your question is not a good fit for Stack Overflow as you are asking for opinions/recommendations which is off-topic. Instead, specify a problem you are trying to solve, the research that you have completed and the errors/issues that need to be fixed/corrected. You might try forums such as Reddit or Quora. stackoverflow.com/help/on-topicAssuage
No better answer than this provided by @JohnHanley. Think about authorization, development process, who is in charge of the app according with the environment,...Johm
S
2

I decided to go with separate Cloud Run instances as per my initial thoughts.

Since part of my reasoning for using Cloud Run is to modernize legacy Laravel applications, this approach should work out fine.

As mentioned by the commenters, this a subjective topic, so YMMV.

Spiraea answered 24/8, 2020 at 5:30 Comment(2)
I wonder how did you solve issue with other google services like Pub/Sub, scheduling etc. Create everything manually ?Abyssal
This app didn't use other services, so i didnt have to. It was a Laravel app, so it was self-contained and thus a good fit for Cloud Run.Spiraea

© 2022 - 2024 — McMap. All rights reserved.