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:
- Ensure that you have enabled the Game Services API. Enable Game Services API
- Either choose a shell with Cloud SDK installed, or use an API client:
Go to Google Cloud Console.
From the upper-right corner of the console, click the Activate Cloud Shell button:
Cloud Shell
To launch Cloud Shell, perform the following steps:
A Cloud Shell session opens inside a frame lower on the console.
You use this shell to run gcloud
commands.
Local shell
To install gcloud
, install the Cloud SDK,
which includes the gcloud
command-line tool.
Verify that you have set desired default project for gcloud
command-line tool (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 SDK.
Game Servers requires version 306.0.0
or higher of the SDK.
gcloud version
To update your installation, run the following command:
gcloud components update
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.
Deleting a cluster
Deleting a Game Servers cluster doesn't delete any resources in the cluster.
Console
In the Cloud Console, go to the Realms & Clusters page.
Expand a realm to see the game server clusters that belong to it.
In the last table column for the cluster, click the ellipses more_vert and select Remove game server cluster.
gcloud
You can delete a Game Servers global or regional cluster using
the gcloud
command-line tool.
To delete a global cluster:
Run the following command and replace the placeholder values, such as clusterID and realmID, with appropriate values:
gcloud 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.To delete the cluster, run the following command:
gcloud game servers clusters delete clusterID --realm=realmID --no-dry-run
To delete a regional cluster:
Run the following command and replace the placeholder values, such as clusterID, with appropriate values:
gcloud 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.To delete the cluster, run the following command:
gcloud 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.
Go
To learn how to install and use the client library for Game Servers, see the Game Servers Client Libraries.
Java
To learn how to install and use the client library for Game Servers, see the Game Servers Client Libraries.
Node.js
To learn how to install and use the client library for Game Servers, see the Game Servers Client Libraries.
Python
To learn how to install and use the client library for Game Servers, see the Game Servers Client Libraries.
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 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 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 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.