Note:
This documentation is for version2.5.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 \u003ccode\u003eGoogle.Cloud.Container.V1\u003c/code\u003e library is a .NET client for the Google Kubernetes Engine API, designed for managing and interacting with Kubernetes clusters.\u003c/p\u003e\n"],["\u003cp\u003eVersion 3.33.0 is the latest release for this library, with a wide range of versions, going all the way back to 2.3.0, available for use.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication with the API when running on Google Cloud Platform requires no configuration, however for external usage, a service account JSON file is needed.\u003c/p\u003e\n"],["\u003cp\u003eThe library can be installed from NuGet, and the primary method of interaction is through the \u003ccode\u003eClusterManagerClient\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe provided sample code demonstrates how to list all clusters across different zones, showcasing basic functionality within the library.\u003c/p\u003e\n"]]],[],null,[]]