Note:
This documentation is for version3.13.0of the library.
Some samples may not work with other versions.
Installation
Install theGoogle.Cloud.Container.V1package 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 theGOOGLE_APPLICATION_CREDENTIALSenvironment variable to refer to it.
The credentials will automatically be used to authenticate. See theGetting Started With
Authenticationguide 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"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe latest version of the Google.Cloud.Container.V1 .NET client library is 3.33.0, with numerous previous versions available, including the documented version 3.13.0.\u003c/p\u003e\n"],["\u003cp\u003eThis library provides access to the Google Kubernetes Engine API, which can be found with more details in its REST reference documentation.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication on Google Cloud Platform is seamless, while off-platform authentication requires setting the \u003ccode\u003eGOOGLE_APPLICATION_CREDENTIALS\u003c/code\u003e environment variable with a service account JSON file.\u003c/p\u003e\n"],["\u003cp\u003eAll API operations using the library are managed through the \u003ccode\u003eClusterManagerClient\u003c/code\u003e, as demonstrated by the sample code for listing clusters.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation provided is specific to version 3.13.0 of the library, and therefore, some samples provided may not be compatible with other versions.\u003c/p\u003e\n"]]],[],null,[]]