k8sOperator 1.0.0-alpha0017
This is a prerelease version of k8sOperator.
dotnet add package k8sOperator --version 1.0.0-alpha0017
NuGet\Install-Package k8sOperator -Version 1.0.0-alpha0017
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="k8sOperator" Version="1.0.0-alpha0017" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="k8sOperator" Version="1.0.0-alpha0017" />
<PackageReference Include="k8sOperator" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add k8sOperator --version 1.0.0-alpha0017
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: k8sOperator, 1.0.0-alpha0017"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package k8sOperator@1.0.0-alpha0017
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=k8sOperator&version=1.0.0-alpha0017&prerelease
#tool nuget:?package=k8sOperator&version=1.0.0-alpha0017&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
k8sOperator
A modern Kubernetes Operator framework for .NET that makes it easy to build custom controllers and operators.
Features
- 🎯 Simple API - Fluent builder pattern for Kubernetes resources
- 🔄 Reconciliation - Built-in controller pattern with informers and caching
- 📦 Custom Resources - Full CRD support with type-safe definitions
- 🗳️ Leader Election - High availability out of the box
- 🚀 AOT Ready - Optimized for trimmed, single-file deployments
- 🛠️ CLI Included - Built-in commands for install, create, and version
- 📊 Source Generators - Automatic builder extensions for your resources
Installation
dotnet add package k8sOperator
Quick Start
1. Define Your Custom Resource
[KubernetesEntity(Group = "demo.k8s.io", ApiVersion = "v1", Kind = "MyApp")]
public class MyApp : CustomResource<MyAppSpec, MyAppStatus>
{
}
public class MyAppSpec
{
public string Image { get; set; }
public int Replicas { get; set; }
}
public class MyAppStatus
{
public string Phase { get; set; }
}
2. Create a Reconciler
public class MyAppReconciler : Reconciler<MyApp>
{
public override async Task<ReconcileResult> ReconcileAsync(
ReconcileContext<MyApp> context,
CancellationToken cancellationToken)
{
var app = context.Resource;
// Your reconciliation logic
// Create/update deployments, services, etc.
context.Update(x => {
x.WithStatus(x =>
{
x.State = "completed";
x.CompletedAt = DateTime.UtcNow;
x.Message = "Todo item has been completed.";
x.ReconciliationCount++;
});
});
}
}
3. Register and Run
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOperator(options =>
{
options.Name = "my-operator";
options.Namespace = "default";
});
var app = builder.Build();
appapp.AddReconciler<MyApp>(MyOperator.ReconcileAsync);
await app.RunOperatorAsync(args);
Building Resources
Use the fluent builder API:
var deployment = ObjectBuilder.Create<V1Deployment>()
.WithName("my-app")
.WithNamespace("default")
.WithLabel("app", "my-app")
.WithSpec(spec => spec
.WithReplicas(3)
.WithTemplate(template => template
.WithSpec(podSpec => podSpec
.WithContainer(c => c
.WithImage("nginx:latest")
.WithPort(80)))))
.Build();
CLI Commands
# Show version
myoperator version
# Install CRDs
myoperator install
# Create resource
myoperator create myapp --name demo
# Show help
myoperator help
Configuration
Configure via appsettings.json or attributes:
{
"Operator": {
"Name": "my-operator",
"Namespace": "default",
}
}
Links
Requirements
- .NET 10.0 or later
- Kubernetes 1.25+
License
MIT License
Built with ❤️ by Patrick Evers
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- KubernetesClient (>= 18.0.13)
- Microsoft.Extensions.Hosting (>= 10.0.3)
- Microsoft.Extensions.Logging (>= 10.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha0017 | 161 | 2/23/2026 |
| 1.0.0-alpha0016 | 64 | 2/23/2026 |
| 1.0.0-alpha0015 | 79 | 2/23/2026 |
| 1.0.0-alpha0014 | 127 | 2/18/2026 |
| 1.0.0-alpha0013 | 67 | 2/18/2026 |
| 1.0.0-alpha0012 | 63 | 2/18/2026 |
| 1.0.0-alpha0011 | 89 | 2/17/2026 |
| 1.0.0-alpha0010 | 66 | 2/17/2026 |
| 1.0.0-alpha0008 | 68 | 2/13/2026 |
| 1.0.0-alpha0007 | 121 | 2/12/2026 |
| 1.0.0-alpha0006 | 77 | 2/12/2026 |
| 1.0.0-alpha0005 | 70 | 2/12/2026 |
| 1.0.0-alpha0004 | 74 | 2/11/2026 |
| 1.0.0-alpha0003 | 76 | 2/10/2026 |
| 1.0.0-alpha0002 | 69 | 2/10/2026 |
| 1.0.0-alpha0001 | 106 | 2/6/2026 |