Deleting a cluster

This page explains how to delete a Game Servers cluster.

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:

Set up default gcloud settings using one of the following methods:

  • Using gcloud init, if you want to be walked through setting defaults.
  • Using gcloud config, to individually set your project ID.

Using gcloud init

  1. Run gcloud init and follow the directions:

    gcloud init

    If you are using SSH on a remote server, use the --console-only flag to prevent the command from launching a browser:

    gcloud init --console-only
  2. Follow the instructions to authorize gcloud to use your Google Cloud account.
  3. Create a new configuration or select an existing one.
  4. Choose a Google Cloud project.
  5. Choose a default Compute Engine zone.

Using gcloud config

  • Set your default project ID:
    gcloud config set project [PROJECT_ID]
  • Update gcloud to the latest version:
    gcloud components update

Deleting a cluster

Deleting a Game Servers cluster doesn't delete any resources in the cluster.

You can delete a Game Servers global or regional cluster using the gcloud command-line tool.

To delete a global cluster:

  1. Run the following command and replace the placeholder values, such as clusterID and realmID, with appropriate values:

    gcloud beta game servers clusters delete clusterID --realm=realmID --dry-run
    

    The output returns the targetState so that you can preview the operation before deleting the cluster.

  2. To delete the cluster, run the following command:

    gcloud beta game servers clusters delete clusterID --realm=realmID --no-dry-run
    

To delete a regional cluster:

  1. Run the following command and replace the placeholder values, such as clusterID, with appropriate values:

    gcloud beta game servers clusters delete clusterID --realm=realmID --location=region --dry-run
    

    The output returns the targetState so that you can preview the operation before deleting the cluster.

  2. To delete the cluster, run the following command:

    gcloud beta game servers clusters delete clusterID --realm=realmID --location=region --no-dry-run
    

The variable placeholders correspond to the following descriptions:

  • clusterID is the unique identifier that you specified for this cluster.
  • realmID is the unique identifier that you specified for the parent realm of this cluster.
  • region is the region for the cluster, if applicable. Pick the same location as the parent realm.

Verifying that your cluster has been deleted

Verify that you successfully deleted the cluster by listing your global or regional clusters using the gcloud command-line tool.

To list all clusters, run the following command:

gcloud beta game servers clusters list

To list clusters in a region, run the following command and replace region with the region that you want to list the clusters in:

gcloud beta game servers clusters list --location=region

To list all clusters in a realm, run the following command and replace realmID with the parent realm and region with the region of the cluster, if applicable:

gcloud beta game servers clusters list --realm=realmID --location=region

Your deleted cluster no longer appears in the output of the command.

What's next

Learn about key concepts in the Game Servers overview.