Creating a deployment

Stay organized with collections Save and categorize content based on your preferences.

This page explains how to create, list, describe, and update Game Servers deployments. A deployment manages one or more software versions that you can deploy to any or all realms. To see an end-to-end example of how to create a deployment, add a config, and then roll it out, see Configuring cluster scaling behavior.

Before you begin

Before you start, we recommend you familiarize yourself with key concepts in the Game Servers Overview. Make sure you have also performed the following tasks:

  • Ensure that you have enabled the Game Services API.
  • Enable Game Services API
  • Either choose a shell with gcloud CLI installed, or use an API client:
  • Cloud Shell

    To launch Cloud Shell, perform the following steps:

    1. Go to Google Cloud console.

      Google Cloud console

    2. From the upper-right corner of the console, click the Activate Cloud Shell button:

    A Cloud Shell session opens inside a frame lower on the console. You use this shell to run gcloud commands.

    Local shell

    Install the gcloud CLI.

    Verify that you have set desired default project for Google Cloud CLI (otherwise you need to specify flag --project explicitly for each command later):

    gcloud config list project
    

    If not you can run the following command to set a default project, replacing PROJECT_ID with your desired project ID :

    gcloud config set project PROJECT_ID
    

    Run the following command to verify your version of the Google Cloud CLI. Game Servers requires version 306.0.0 or higher of the gcloud CLI.

    gcloud version
    

    To update your installation, run the following command:

    gcloud components update
    

    curl / PowerShell

    To use the REST API with curl or Windows PowerShell, do the following:

    1. Create a service account.
    2. Download a private key as a JSON file.
    3. Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again.

    Client Library

    Google Cloud Game Servers can be controlled programmatically using a client library. See Client Libraries Overview for instructions on using the library and authenticating.

Creating a deployment

Console

  1. In the Google Cloud console, go to the Game Server Deployments page.

    Go to Game Servers

  2. Click Create Deployment.

  3. In the Name box, enter a unique identifier for this deployment.

  4. (Optional) In the Description box, enter a description for this deployment.

  5. Click Create.

gcloud

You can create a deployment using the Google Cloud CLI.

To create a deployment, run the following command and replace the deploymentID, with an appropriate value:

gcloud game servers deployments create deploymentID

REST & CMD LINE

Before using any of the request data, make the following replacements:

  • PROJECT_ID: your Google Cloud project ID listed in the IAM Settings
  • DEPLOYMENT_ID: a user-defined identifier for the deployment

Request JSON body:

{
  "name": "projects/PROJECT_ID/locations/global/gameServerDeployments/DEPLOYMENT_ID",
}

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_ID/locations/global/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.gaming.v1.OperationMetadata",
    "createTime": CREATE_TIME,
    "target": "projects/PROJECT_ID/locations/global/gameServerDeployments/DEPLOYMENT_ID",
    "verb": "create",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}

Listing deployments

Console

  1. In the Google Cloud console, go to the Game Server Deployments page.

    Go to Game Servers

  2. You can use the filter box to filter the deployments list by different properties.

gcloud

You can list deployments using the Google Cloud CLI.

To list deployments, run the following command:

gcloud game servers deployments list

REST & CMD LINE

Before using any of the request data, make the following replacements:

  • PROJECT_ID: your Google Cloud project ID listed in the IAM Settings

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "gameServerDeployments": [
    {
      "name": "projects/PROJECT_ID/locations/global/gameServerDeployments/my-deployment-1",
      "createTime": CREATE_TIME,
      "updateTime": UPDATE_TIME,
      "etag": "RI8hTm3ZaMNZ3qRVeKVcxcN3W26_oR559JYofnFi69A"
    },
    {
      "name": "projects/PROJECT_ID/locations/global/gameServerDeployments/my-deployment-2",
      "createTime": CREATE_TIME,
      "updateTime": UPDATE_TIME,
      "etag": "az38kwIY4X3WdP2SA0fkTGib9hwVj7iXLFXAtIzMLpc"
    }
  ]
}

Describing a deployment

Console

  1. In the Google Cloud console, go to the Game Server Deployments page.

    Go to Game Servers

  2. You can use the filter box to filter the deployments list by different properties.

  3. In the last table column, click the ellipses and select List configs. You can view the active and inactive configs for the deployment from this page.

  4. To create a new config for the deployment, click Create Config. To update the rollout, click Manage Rollout.

gcloud

You can obtain details about a deployment, such as the creation time or update time, using the Google Cloud CLI.

To describe a deployment, run the following command and replace deploymentID with the identifier for a deployment you have previously created:

gcloud game servers deployments describe deploymentID

REST & CMD LINE

Before using any of the request data, make the following replacements:

  • PROJECT_ID: your Google Cloud project ID listed in the IAM Settings
  • DEPLOYMENT_ID: the user-defined identifier for the deployment

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_ID/locations/global/gameServerDeployments/DEPLOYMENT_ID",
  "createTime": CREATE_TIME,
  "updateTime": UPDATE_TIME,
  "etag": "RI8hTm3ZaMNZ3qRVeKVcxcN3W26_oR559JYofnFi69A"
}

Updating a deployment

gcloud

To update a field for a deployment, run the gcloud game servers deployments update command after replacing the deploymentID for an existing deployment. The following command updates the description field for a deployment.

gcloud game servers deployments update deploymentID --description="My updated description"

To find the flags for other deployment fields, see the gcloud reference.

REST & CMD LINE

The following sample updates the description field. To update other fields, add the field names to the ?updateMask= query parameter and request JSON body.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: your Google Cloud project ID listed in the IAM Settings
  • DEPLOYMENT_ID: the user-defined identifier for the deployment

Request JSON body:

{
  "description": "My updated description"
}

To send your request, expand one of these options:

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_ID/locations/global/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.gaming.v1.OperationMetadata",
    "createTime": CREATE_TIME,
    "target": "projects/PROJECT_ID/locations/global/gameServerDeployments/DEPLOYMENT_ID",
    "verb": "update",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}

What's next