Saturday, April 27, 2024
No menu items!
HomeCloud ComputingDistributing software everywhere, all at once - a look at Cloud Deploy...

Distributing software everywhere, all at once – a look at Cloud Deploy multi-target

As a developer, I’ve long dreamed of releasing to multiple targets at once – it speeds things up, and simplifies operations. Finally it’s real.

This is all possible in the latest Cloud Deploy Public Preview. Whether you’re trying to improve release performance or organize your deployment phase targets – gone are the days of waiting hours to get a release out to all of your clusters.

What’s new?

Now you can concurrently deploy to all members in a group of either Google Kuberentes Engine clusters, Cloud Run instances, or Anthos clusters at once. 

For globally distributed applications, it is common to have multiple clusters in multiple regions. Until now, updating all clusters would require waiting for a sequential Cloud Deploy pipeline to run and update each cluster, one at a time, which is not optimal. It often looks like this:

Now, with the new parallel deployment feature in Cloud Deploy, you can update all clusters in a “group” at the same time, like this:

What does this look like in practice?

This feature is commonly requested for managing the rollout of a release across multiple clusters and regions – especially for users of Agones, the popular cloud game server orchestration system used by many in the gaming industry. Since Cloud Deploy is powered by Skaffold, it can handle any kind of Kubernetes YAML resource (even Custom Resource Definitions), making it fully compatible with Agones.

Often a release (or new Agones Fleet) will go out to a particular part of the world first – say several Google Kubernetes Engine clusters in Australia (it could be any region – but pick one initial region to test against). Assuming the release looks good, then it could get promoted to all clusters in European regions, then North America, and so on. Each region could have its own multiTarget-enabled Target within the Agones Fleet DeliveryPipeline. A single delivery pipeline stage for one part of the world might look like this under the hood:

To start using this with an existing Cloud Deploy setup, there really isn’t much you need to do. We have introduced a new configuration option within the Cloud Deploy Target resource called multiTarget. All you need to do is specify existing targets under multiTarget that you want to be part of your new Target resource “group”, like this:

code_block[StructValue([(u’code’, u’apiVersion: deploy.cloud.google.com/v1rnkind: Targetrnmetadata:rn name: TARGET_NAMErndescription: TARGET_DESCRIPTIONrnmultiTarget:rn targetIds: [ CHILD_TARGET1, CHILD_TARGET2, CHILD_TARGETn ]’), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3eb9905f1f90>)])]

If you don’t have existing Target to reference as a child in the multiTarget, you can specify one like this:

code_block[StructValue([(u’code’, u’apiVersion: deploy.cloud.google.com/v1rnkind: Targetrnmetadata:rn name: CHILD_TARGET1rndescription: TARGET_DESCRIPTIONrngke:rn cluster: projects/PROJECT_ID/locations/REGION/clusters/CLUSTER_NAME’), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3eb971e0d190>)])]

And a second Target, like this:

code_block[StructValue([(u’code’, u’apiVersion: deploy.cloud.google.com/v1rnkind: Targetrnmetadata:rn name: CHILD_TARGET2rndescription: TARGET_DESCRIPTIONrngke:rn cluster: projects/PROJECT_ID/locations/REGION/clusters/CLUSTER_NAME’), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3eb990758b90>)])]

An example you can try

If you have an existing Agones GKE cluster, you can use the following configuration to test out the parallel deploy feature, using the new multiTarget feature explained previously.

code_block[StructValue([(u’code’, u’apiVersion: skaffold/v4beta1rnkind: Configrnmetadata:rn name: gamernmanifests:rn rawYaml:rn – fleet.yaml’), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3eb971e0aad0>)])]
code_block[StructValue([(u’code’, u’apiVersion: “agones.dev/v1″rnkind: Fleetrnmetadata:rn name: simple-game-serverrnspec:rn replicas: 3rn template:rn spec:rn ports:rn – name: defaultrn containerPort: 7654rn template:rn spec:rn containers:rn – name: simple-game-serverrn image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.14′), (u’language’, u”), (u’caption’, <wagtail.wagtailcore.rich_text.RichText object at 0x3eb971e0ad90>)])]

If you don’t already have an Agones GKE cluster running, no worries. The takeaway here is that there is nothing special in our skaffold.yaml – working with Agones objects is the same as any other Kubernetes object. Likewise, no changes to the Skaffold configuration are required to take advantage of parallel deployment.

Thanks so much for reading. You can learn more about using Cloud Deploy with Google Kubernetes Engine with this tutorial. If you want to learn more about Cloud Deploy and the new Parallel Deployment feature check out the links below.

Further reading

Cloud Deploy Parallel Deployment Documentation

Agones on GitHub

Getting Started with Skaffold – a quickstart tutorial

Using Cloud Deploy with Cloud Run tutorial

Related Article

Run your game infrastructure on GKE Autopilot to focus on player experience

GKE Autopilot can automate provisioning and right-sizing your pods to make your games run smoothly on Google Cloud.

Read Article

Cloud BlogRead More

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments