Note:
This documentation is for version3.20.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, 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 theAuthentication
use casesguide 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 interacting with the Google Kubernetes Engine API.\u003c/p\u003e\n"],["\u003cp\u003eThis documentation is specifically for version 3.20.0 of the library, and some samples might not be compatible with other versions.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this library is version 3.33.0, but a variety of other versions dating back to 2.3.0 are accessible.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication with the API when running on Google Cloud is automatic, but for other environments, using a service account JSON file and the \u003ccode\u003eGOOGLE_APPLICATION_CREDENTIALS\u003c/code\u003e variable is recommended.\u003c/p\u003e\n"],["\u003cp\u003eAll API operations are carried out using the \u003ccode\u003eClusterManagerClient\u003c/code\u003e, which can be used to list clusters, as demonstrated in the included sample code.\u003c/p\u003e\n"]]],[],null,[]]