Note:
This documentation is for version 3.16.0 of the library.
Some samples may not work with other versions.
Installation
Install the Google.Cloud.Container.V1 package from NuGet. Add it to
your project in the normal way (for example by right-clicking on the
project in Visual Studio and choosing "Manage NuGet Packages...").
Authentication
When running on Google Cloud Platform, no action needs to be taken to authenticate.
Otherwise, the simplest way of authenticating your API calls is to
download a service account JSON file then set the GOOGLE_APPLICATION_CREDENTIALS environment variable to refer to it.
The credentials will automatically be used to authenticate. See the Getting Started With
Authentication guide for more details.
ClusterManagerClient client = ClusterManagerClient.Create();
// You can list clusters in a single zone, or specify "-" for all zones.
LocationName location = new LocationName(projectId, locationId: "-");
ListClustersResponse zones = client.ListClusters(location.ToString());
foreach (Cluster cluster in zones.Clusters)
{
Console.WriteLine($"Cluster {cluster.Name} in {cluster.Location}");
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eGoogle.Cloud.Container.V1\u003c/code\u003e library is a .NET client for the Google Kubernetes Engine API, facilitating interactions with Google's container orchestration service.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this library is 3.33.0, and the provided documentation specifically pertains to version 3.16.0.\u003c/p\u003e\n"],["\u003cp\u003eInstallation of the library is performed through the NuGet package manager, which can be done by adding the \u003ccode\u003eGoogle.Cloud.Container.V1\u003c/code\u003e package to your .NET project.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication on Google Cloud Platform is automatic, but for other environments, authentication requires setting the \u003ccode\u003eGOOGLE_APPLICATION_CREDENTIALS\u003c/code\u003e environment variable to the path of a service account JSON file.\u003c/p\u003e\n"],["\u003cp\u003eAll actions and operations are to be performed using the \u003ccode\u003eClusterManagerClient\u003c/code\u003e class, which can be used to list clusters, as demonstrated in the sample code provided.\u003c/p\u003e\n"]]],[],null,[]]