Pól
Pól

Reputation: 139

Best Strategy for deploying test and dev app versions to Google Compute Platform

Google Compute Platform

I've got an Angular (2) app and a Node.js middleware (Loopback) running as Services in an App Engine in a project. For the database, we have a Compute Engine running PostgreSQL in that same project.

What we want

The testing has gone well, and we now want to have a test version (for ongoing upgrade testing/demo/etc) and a release deployment that is more stable for our initial internal clients.

We are going to use a different database in psql for the release version, but could use the same server for our test and deployed apps.

Should we....?

  1. create another GCP project and another gcloud setup on my local box to deploy to that new project for our release deployment,
  2. or is it better to deploy multiple versions of the services to the single project with different prefixes - and how do I do that?

Cost is a big concern for our little nonprofit. :)

Upvotes: 0

Views: 59

Answers (1)

Sandeep Dinesh
Sandeep Dinesh

Reputation: 2135

My recommendation is the following:

Create two projects, one for each database instance. You can mess around all you want in the test project, and don't have to worry about messing up your prod deployment. You would need to store your database credentials securely somewhere. A possible solution is to use Google Cloud Project Metadata, so your code can stay the same between projects.

When you are ready to deploy to production, I would recommend deploying a new version of your App Engine app in the production project, but not promoting it to the default.

gcloud app deploy --no-promote

This means customers will still go to the old version, but the new version will be deployed so you can make sure everything is working. After that, you can slowly (or quickly) move traffic over to the new version.

At about 8:45 into this video, traffic splitting is demoed: https://vimeo.com/180426390

Also, I would recommend aggressively shutting down unused App Engine Flexible deployments to save costs. You can read more here.

Upvotes: 2

Related Questions