{"id":13531614,"url":"https://github.com/buehler/dotnet-operator-sdk","last_synced_at":"2025-05-14T15:06:48.518Z","repository":{"id":37673827,"uuid":"261514821","full_name":"buehler/dotnet-operator-sdk","owner":"buehler","description":"KubeOps is a kubernetes operator sdk in dotnet. Strongly inspired by kubebuilder.","archived":false,"fork":false,"pushed_at":"2025-04-11T06:51:33.000Z","size":3654,"stargazers_count":259,"open_issues_count":28,"forks_count":71,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-13T01:59:22.873Z","etag":null,"topics":["crds","dotnet","kubernetes","kubernetes-operator-sdk","operator","sdk"],"latest_commit_sha":null,"homepage":"https://buehler.github.io/dotnet-operator-sdk/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buehler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["buehler"],"custom":["https://paypal.me/rbbit"]}},"created_at":"2020-05-05T15:46:43.000Z","updated_at":"2025-04-11T18:04:27.000Z","dependencies_parsed_at":"2023-12-03T21:21:52.567Z","dependency_job_id":"2724a9f4-b971-4115-8f4d-4eb0f0de1a05","html_url":"https://github.com/buehler/dotnet-operator-sdk","commit_stats":{"total_commits":749,"total_committers":41,"mean_commits":18.26829268292683,"dds":0.7903871829105474,"last_synced_commit":"092ae455b3eebd1ce874af54e4118102d86f510b"},"previous_names":[],"tags_count":250,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buehler%2Fdotnet-operator-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buehler%2Fdotnet-operator-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buehler%2Fdotnet-operator-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buehler%2Fdotnet-operator-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buehler","download_url":"https://codeload.github.com/buehler/dotnet-operator-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654047,"owners_count":21140235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crds","dotnet","kubernetes","kubernetes-operator-sdk","operator","sdk"],"created_at":"2024-08-01T07:01:04.340Z","updated_at":"2025-05-14T15:06:48.497Z","avatar_url":"https://github.com/buehler.png","language":"C#","funding_links":["https://github.com/sponsors/buehler","https://paypal.me/rbbit"],"categories":["Operator Frameworks","kubernetes","dotnet"],"sub_categories":[],"readme":"# KubeOps\n\n**Build Kubernetes Operators in .NET with Ease**\n\n[![.NET Pre-Release](https://github.com/buehler/dotnet-operator-sdk/actions/workflows/dotnet-release.yml/badge.svg?branch=main)](https://github.com/buehler/dotnet-operator-sdk/actions/workflows/dotnet-release.yml)\n[![.NET Release](https://github.com/buehler/dotnet-operator-sdk/actions/workflows/dotnet-release.yml/badge.svg?branch=release)](https://github.com/buehler/dotnet-operator-sdk/actions/workflows/dotnet-release.yml)\n[![Scheduled Code Security Testing](https://github.com/buehler/dotnet-operator-sdk/actions/workflows/security-analysis.yml/badge.svg?event=schedule)](https://github.com/buehler/dotnet-operator-sdk/actions/workflows/security-analysis.yml)\n\n**KubeOps** is a [Kubernetes Operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) SDK designed for [.NET](https://dotnet.microsoft.com/) developers. It allows you to leverage your C# skills and the rich .NET ecosystem to build powerful Kubernetes controllers that automate the management of complex applications. KubeOps simplifies operator development by providing high-level abstractions, code generators, and helper utilities.\n\n**For comprehensive documentation, tutorials, and API references, please visit the official [KubeOps Documentation Site](https://buehler.github.io/dotnet-operator-sdk/).**\n\nThe documentation is also provided within the code itself (description of methods and classes), and each package contains a README with further information.\n\n## Key Features\n\n*   **Define CRDs in C#:** Model your [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/) using plain C# classes and attributes.\n*   **Controller Logic:** Implement reconciliation logic using the `IResourceController\u003cTEntity\u003e` interface.\n*   **Finalizers:** Easily add cleanup logic before resource deletion with `IResourceFinalizer\u003cTEntity\u003e`.\n*   **Webhooks:** Create [Admission](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/) (validating/mutating) and [Conversion](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning/#webhook-conversion) webhooks integrated with ASP.NET Core.\n*   **Code Generation:** Includes Roslyn source generators and a CLI tool (`dotnet kubeops`) to automate boilerplate code for CRDs, controllers, and RBAC rules.\n*   **Enhanced Kubernetes Client:** Provides convenience methods built on top of the official client library.\n*   **Leader Election:** Automatic handling for high-availability operator deployments.\n*   **Testing Support:** Provides utilities and patterns to help with unit and integration testing.\n\n## Getting Started\n\nThe quickest way to start building an operator with KubeOps is by using the CLI tool:\n\n1.  **Install the CLI:**\n    ```bash\n    dotnet tool install --global KubeOps.Cli\n    ```\n    *(Or `dotnet tool update --global KubeOps.Cli` to get the latest version)*\n\n2.  **Create a new operator project:**\n    ```bash\n    dotnet kubeops new operator MyOperator\n    cd MyOperator\n    ```\n\n3.  **Explore the code:** The template generates a basic operator structure with a sample custom resource, controller, and finalizer.\n\n4.  **Dive deeper:** Follow the tutorials and guides on the [KubeOps Documentation Site](https://buehler.github.io/dotnet-operator-sdk/).\n\n## Packages\n\nAll packages target [.NET 8.0](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8/overview) and [.NET 9.0](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview), leveraging modern C# features. The underlying Kubernetes client library (`KubernetesClient.Official`) also follows this versioning strategy.\n\nThe SDK is designed to be modular. You can include only the packages you need:\n\n| Package                                                              | Description                                                                                                                                                             | Latest Version                                                                                                                                                          |\n|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [KubeOps.Abstractions](./src/KubeOps.Abstractions/README.md)         | Defines core interfaces, attributes (like `[KubernetesEntity]`), and base classes used across the SDK. Essential for defining your custom resources and controllers.       | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.Abstractions?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.Abstractions/absoluteLatest)         |\n| [KubeOps.Cli](./src/KubeOps.Cli/README.md)                           | A [.NET Tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) providing commands for scaffolding projects, generating [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/), and more. | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.Cli?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.Cli/absoluteLatest)                           |\n| [KubeOps.Generator](./src/KubeOps.Generator/README.md)               | Contains [Roslyn Source Generators](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview) to automate boilerplate code generation for CRDs and controllers based on your definitions. | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.Generator?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.Generator/absoluteLatest)               |\n| [KubeOps.KubernetesClient](./src/KubeOps.KubernetesClient/README.md) | Provides an enhanced client for interacting with the [Kubernetes API](https://kubernetes.io/docs/reference/kubernetes-api/), built on top of the official `KubernetesClient` library. Offers convenience methods for common operator tasks. | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.KubernetesClient?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.KubernetesClient/absoluteLatest) |\n| [KubeOps.Operator](./src/KubeOps.Operator/README.md)                 | The main engine of the SDK. Handles reconciling resources, watching for changes, and managing the operator lifecycle. This is the primary package needed to run an operator. | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.Operator?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.Operator/absoluteLatest)                 |\n| [KubeOps.Operator.Web](./src/KubeOps.Operator.Web/README.md)         | Integrates the operator with ASP.NET Core to expose endpoints for features like [Admission Webhooks](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/). | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.Operator.Web?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.Operator.Web/absoluteLatest)         |\n| [KubeOps.Transpiler](./src/KubeOps.Transpiler/README.md)             | Utilities for converting .NET type definitions into Kubernetes YAML manifests, specifically for [CRDs](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/) and [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) rules. | [![Nuget](https://img.shields.io/nuget/vpre/KubeOps.Transpiler?label=nuget%20prerelease)](https://www.nuget.org/packages/KubeOps.Transpiler/absoluteLatest)             |\n\n*Note: NuGet badges show the latest pre-release version.*\n\n## Examples\n\nYou can find various example operators demonstrating different features in the [`examples/`](https://github.com/ewassef/dotnet-operator-sdk/tree/main/examples/) directory of this repository.\n\n## Governance\n\nKubeOps is currently maintained by [the original author/maintainer team - consider listing names or linking to GitHub profiles/team page]. We welcome community contributions and aim to foster an open and collaborative development process. As the project grows, we may establish a more formal governance structure. Decision-making primarily occurs through GitHub issues and pull requests.\n\n## Contribution\n\nIf you want to contribute, feel free to open a pull request or write issues :-)\nPlease note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md).\nBy participating in this project you agree to abide by its terms.\n+\n Read more about contribution (especially for setting up your local environment)\n in the [CONTRIBUTING file](./CONTRIBUTING.md).\n\nIn short:\n\n- Check out the code\n- Develop on KubeOps\n- Use some Kubernetes to run the test operator against\n- Create tests\n- Build the whole solution (lint warnings will result in an error)\n- Open PR\n\n## Motivation\n\nKubeOps aims to provide a first-class experience for developing Kubernetes operators within the .NET ecosystem, offering an alternative to Go-based SDKs like Kubebuilder and Operator SDK, while embracing familiar C# patterns and tooling.\n\n**Why choose KubeOps?**\n\n*   **Leverage your .NET Skills:** Build operators using C#, a language you already know, with access to the extensive .NET Base Class Library and NuGet ecosystem.\n*   **Strong Typing \u0026 IDE Support:** Benefit from compile-time checks and rich IDE features like IntelliSense and debugging.\n*   **Simplified Abstractions:** Focus on your reconciliation logic, not Kubernetes API boilerplate.\n*   **Code Generation:** Reduce manual effort with generators for CRDs, RBAC, and controller/webhook registrations.\n*   **Integrated Testing:** Develop unit and integration tests using familiar .NET testing frameworks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuehler%2Fdotnet-operator-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuehler%2Fdotnet-operator-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuehler%2Fdotnet-operator-sdk/lists"}