- Building Google Cloud Platform Solutions
- Ted Hunter Steven Porter Legorie Rajan PS
- 251字
- 2025-04-04 14:47:41
Deploying a service to the flexible environment
Services built for the flexible environment are deployed in a similar manner as the standard environment, using the same gcloud app deploy command. Building on previous examples, a simple Node.js implementation of the colors service has been provided using a custom runtime. To deploy this service, go to chapter_04/example_04 in this book's source code and run:
gcloud app deploy app.yaml
You will notice that the deployment process for this service is much slower than in earlier examples. This is largely due to the fact that App Engine must build a new Docker image for the service and provision a Compute Engine VM, both of which take a non-trivial amount of time.
Once the service has been deployed, it can be managed through similar means as our examples using the standard environment. Services can be started and stopped on a per-version basis, and traffic can be split between services running in either environment. Building on our previous example on splitting network traffic, we can now split traffic to our colors service three ways between the Go version, the Java version, and the new Node.js version running in the flexible environment, illustrated as follows:
