Work In Progress
Branch: master
Clone or download

Kubernetes C# Client

Travis Client Capabilities Client Support Level


Nuget Package

dotnet add package KubernetesClient

Generating the Client Code


You'll need a Linux machine with Docker.

The generated code works on all platforms supported by .NET or .NET Core.

Check out the generator project into some other directory (henceforth $GEN_DIR)

cd $GEN_DIR/..
git clone

Generating code

# Where REPO_DIR points to the root of the csharp repository
cd ${REPO_DIR}/csharp/src
${GEN_DIR}/openapi/ generated ../csharp.settings


Running the Examples

git clone
cd csharp\examples\simple
dotnet run

Known issues

While preferred way of connecting to a remote cluster from local machine is:

var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
var client = new Kubernetes(config);

Not all auth providers are supported at moment #91, but you still can connect to cluster by starting proxy:

$ kubectl proxy
Starting to serve on

and changing config:

var config = new KubernetesClientConfiguration {  Host = "" };

Notice that this is a workaround and is not recommended for production use


The project uses XUnit as unit testing framework.

To run the tests

cd csharp\tests
dotnet restore
dotnet test


Please see for instructions on how to contribute.