KubeOps.Cli 8.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global KubeOps.Cli --version 8.0.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local KubeOps.Cli --version 8.0.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=KubeOps.Cli&version=8.0.0
nuke :add-package KubeOps.Cli --version 8.0.0

KubeOps CLI

.NET tool to help managing your KubeOps project. It allows you to generate the needed files for your operator as well as managing resources in your Kubernetes cluster.

Installation

To install the CLI into your solution / project, first create a new tool manifest:

dotnet new tool-manifest

Then install the CLI:

dotnet tool install KubeOps.Cli

This allows you to use the CLI with dotnet kubeops.

Available Commands

Here is a brief overview over the available commands (for all options and descriptions, use -h or --help):

  • version: prints the version information for the actual connected Kubernetes cluster
  • install: install the CRDs for the given solution into the cluster
  • uninstall: uninstall the CRDs for the given solution from the cluster
  • generator: entry command for generator commands (i.e. has subcommands), all commands output their result to the stdout or the given output path
    • cert: generate a CA & server certificate for usage with webhooks
    • crd: generate the CRDs
    • docker: generate the dockerfile
    • installer: generate the installer files (i.e. kustomization yaml) for the operator
    • operator: generate the deployment for the operator
    • rbac: generate the needed rbac roles / role bindings for the operator
  • webhook: entry command for webhook related operations
    • install: generate the server certificate and install the service / webhook registration
    • register: register the currently implemented webhooks to the currently selected cluster

Example

When running dotnet kubeops api-version, your output may look like this:

> dotnet kubeops api-version
   Kubernetes API Version
┌─────────────┬─────────────┐
│ Git-Version │ v1.27.2     │
│ Major       │ 1           │
│ Minor       │ 27          │
│ Platform    │ linux/arm64 │
└─────────────┴─────────────┘
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
9.1.2 81 6/20/2024
9.1.1 737 5/22/2024
9.1.0 171 5/15/2024
9.0.2 124 5/13/2024
9.0.0 2,453 3/13/2024
9.0.0-pre.4 82 4/19/2024
9.0.0-pre.3 98 3/21/2024
9.0.0-pre.2 104 3/13/2024
9.0.0-pre.1 98 3/7/2024
8.0.2-pre.2 120 2/21/2024
8.0.2-pre.1 80 2/19/2024
8.0.1 1,880 2/13/2024
8.0.1-pre.7 63 2/12/2024
8.0.1-pre.6 58 2/7/2024
8.0.1-pre.5 80 2/5/2024
8.0.1-pre.4 54 1/31/2024
8.0.1-pre.3 55 1/26/2024
8.0.1-pre.2 66 1/25/2024
8.0.1-pre.1 55 1/18/2024
8.0.0 466 1/17/2024
8.0.0-pre.45 55 1/17/2024
8.0.0-pre.44 60 1/16/2024
8.0.0-pre.43 49 1/16/2024
8.0.0-pre.42 90 1/10/2024
8.0.0-pre.41 145 1/2/2024
8.0.0-pre.40 121 12/27/2023
8.0.0-pre.39 91 12/21/2023
8.0.0-pre.38 128 12/6/2023
8.0.0-pre.37 91 12/6/2023
8.0.0-pre.36 60 12/3/2023
8.0.0-pre.35 81 11/28/2023
8.0.0-pre.34 102 11/24/2023
8.0.0-pre.33 72 11/24/2023
8.0.0-pre.32 73 11/23/2023
8.0.0-pre.31 63 11/23/2023
8.0.0-pre.30 76 11/23/2023
8.0.0-pre.29 75 11/11/2023
8.0.0-pre.28 65 11/8/2023
8.0.0-pre.27 140 10/23/2023
8.0.0-pre.26 76 10/19/2023
8.0.0-pre.25 75 10/18/2023
8.0.0-pre.24 95 10/13/2023
8.0.0-pre.23 73 10/13/2023
8.0.0-pre.22 84 10/13/2023
8.0.0-pre.21 80 10/12/2023
8.0.0-pre.20 70 10/11/2023
8.0.0-pre.19 85 10/9/2023
8.0.0-pre.18 69 10/9/2023
8.0.0-pre.17 69 10/7/2023
8.0.0-pre.16 76 10/6/2023
8.0.0-pre.15 80 10/6/2023
8.0.0-pre.14 68 10/5/2023
8.0.0-pre.13 66 10/5/2023
8.0.0-pre.12 65 10/4/2023
8.0.0-pre.11 75 10/3/2023
8.0.0-pre.10 83 10/3/2023
8.0.0-pre.9 75 10/3/2023
8.0.0-pre.8 69 10/2/2023
8.0.0-pre.7 71 10/2/2023
8.0.0-pre.6 83 9/29/2023
8.0.0-pre.5 58 9/28/2023
8.0.0-pre.4 62 9/28/2023
8.0.0-pre.3 72 9/27/2023
8.0.0-pre.2 48 9/26/2023
8.0.0-pre.1 61 9/22/2023

'# [8.0.0](https://github.com/buehler/dotnet-operator-sdk/compare/v7.6.1...v8.0.0) (2024-01-17)


### Bug Fixes

* add entity UID into event name to generate relation. ([8c1848f](https://github.com/buehler/dotnet-operator-sdk/commit/8c1848fb2a7f813bd1ff0ad1b0c8d12977acb264)), closes [#681](https://github.com/buehler/dotnet-operator-sdk/issues/681)
* allow the CLI to be used in NET6 and NET7 ([0b4aa96](https://github.com/buehler/dotnet-operator-sdk/commit/0b4aa969033f73115c54ad54d6f803189bb8effe))
* **cli:** readd c# support. ([a508b12](https://github.com/buehler/dotnet-operator-sdk/commit/a508b128b3c81ab1363b3aa4a68263d7019e7b4b))
* correct dependency ([7768870](https://github.com/buehler/dotnet-operator-sdk/commit/7768870b85a8242029572ffff86dee013d71ee16))
* **deps:** update dependencies to v0.48.0 ([#667](https://github.com/buehler/dotnet-operator-sdk/issues/667)) ([270cb94](https://github.com/buehler/dotnet-operator-sdk/commit/270cb94621c1275ce3889c04e90dbf06777fedac))
* **deps:** update dependency roslynator.analyzers to v4.6.0 ([8430f7a](https://github.com/buehler/dotnet-operator-sdk/commit/8430f7ae80b46582b8f6216a2ca20d821b572724))
* **deps:** update dependency roslynator.analyzers to v4.6.1 ([c5b1ccf](https://github.com/buehler/dotnet-operator-sdk/commit/c5b1ccf58790a002d792e5bb6e0852620ddadc39))
* **deps:** update dependency roslynator.analyzers to v4.6.2 ([b6ffb31](https://github.com/buehler/dotnet-operator-sdk/commit/b6ffb311cec1070cba47bf92f5646f4119ca11c2))
* **deps:** update dependency roslynator.analyzers to v4.6.4 ([4c802d6](https://github.com/buehler/dotnet-operator-sdk/commit/4c802d6cfa4c7841f7b2c7d7bd8e7428e195de2a))
* **deps:** update dependency roslynator.analyzers to v4.7.0 ([c0a78f5](https://github.com/buehler/dotnet-operator-sdk/commit/c0a78f51e3edb9f44800d9c1ef988f99ed0a15b4))
* **deps:** update dependency roslynator.analyzers to v4.8.0 ([93c562e](https://github.com/buehler/dotnet-operator-sdk/commit/93c562ee27dc295b43819dca80f2ab50764b2a43))
* **deps:** update dependency roslynator.analyzers to v4.9.0 ([db38a6a](https://github.com/buehler/dotnet-operator-sdk/commit/db38a6a63745cf9f19dcd6df7d30702f3ceced53))
* **deps:** update dependency sonaranalyzer.csharp to v9.12.0.78982 ([c3c2443](https://github.com/buehler/dotnet-operator-sdk/commit/c3c2443a389a2f8a300831d2d5200a857f180fc7))
* **deps:** update dependency sonaranalyzer.csharp to v9.14.0.81108 ([c64c094](https://github.com/buehler/dotnet-operator-sdk/commit/c64c094585352a1526448cf5b046b4775b3b7691))
* **deps:** update dependency sonaranalyzer.csharp to v9.15.0.81779 ([fceda09](https://github.com/buehler/dotnet-operator-sdk/commit/fceda094ff20540af37b74ddb71a9b3233c28fab))
* **deps:** update dependency sonaranalyzer.csharp to v9.16.0.82469 ([14ddb86](https://github.com/buehler/dotnet-operator-sdk/commit/14ddb8630052286b610ad92df02caad5c9aee401))
* **generator:** correctly build nuget package ([f9f14d8](https://github.com/buehler/dotnet-operator-sdk/commit/f9f14d8c14a1fb177b61d3275f2bd1249b23ab6c))
* include build output in generator package ([014a7a4](https://github.com/buehler/dotnet-operator-sdk/commit/014a7a4b8d63c7377a2fb27bc5f1371f34a2c475))
* make JsonDiffer thread safe ([#683](https://github.com/buehler/dotnet-operator-sdk/issues/683)) ([5379ee3](https://github.com/buehler/dotnet-operator-sdk/commit/5379ee3de13705ece8a3d30f8831ca21ce734de0))
* **rbac:** do not mix apigroups. ([0b8cbab](https://github.com/buehler/dotnet-operator-sdk/commit/0b8cbab6057ee5233fd9c6bee8df8f5aaa11a6d8)), closes [#583](https://github.com/buehler/dotnet-operator-sdk/issues/583)
* ToExpression(this IEnumerable<LabelSelector> selectors) extension method returns wrong result ([d13cadf](https://github.com/buehler/dotnet-operator-sdk/commit/d13cadf281b229329ded43f67af1d52a666388d5))
* Transpiler inconsistencies for CRDs ([#688](https://github.com/buehler/dotnet-operator-sdk/issues/688)) ([39f5a29](https://github.com/buehler/dotnet-operator-sdk/commit/39f5a29cf7dc3711077a2f3bd2d6682f8322e405))
* use correct targets file ([5b934d0](https://github.com/buehler/dotnet-operator-sdk/commit/5b934d069d2b30caac080f41f2dd91fb37c3b807))
* use get instead of list in kubernetes client. ([83c9210](https://github.com/buehler/dotnet-operator-sdk/commit/83c9210e142486e1da226876f728d4a4d4d6e86c)), closes [#647](https://github.com/buehler/dotnet-operator-sdk/issues/647)
* use resource version in watcher to get newest events from API. ([dd94ff8](https://github.com/buehler/dotnet-operator-sdk/commit/dd94ff8faa0aced6862470d9a78fdac080e2c151)), closes [#675](https://github.com/buehler/dotnet-operator-sdk/issues/675)


### Code Refactoring

* CLI Argument parsing ([#615](https://github.com/buehler/dotnet-operator-sdk/issues/615)) ([02576f4](https://github.com/buehler/dotnet-operator-sdk/commit/02576f44d1b4a214d22cfd87ffa3e4cf5b6be76d))
* **finalizer:** Rework finalizer in controllers ([#625](https://github.com/buehler/dotnet-operator-sdk/issues/625)) ([5e39484](https://github.com/buehler/dotnet-operator-sdk/commit/5e394841aea8325e0bd4237e7a60bd415706af37))
* **operator:** rework event publishing ([#626](https://github.com/buehler/dotnet-operator-sdk/issues/626)) ([d99c7ba](https://github.com/buehler/dotnet-operator-sdk/commit/d99c7ba7259aaa19c22339e7e0c49b0ff8279b1d))
* Split Operator in several packages ([#605](https://github.com/buehler/dotnet-operator-sdk/issues/605)) ([e706f3a](https://github.com/buehler/dotnet-operator-sdk/commit/e706f3a19793f9be9f5ca0da08ce2b1731106da2))
* Transpilation and conversion of objects ([#614](https://github.com/buehler/dotnet-operator-sdk/issues/614)) ([e17cd8c](https://github.com/buehler/dotnet-operator-sdk/commit/e17cd8c1aaa5bf4736e9249121adbb3bab8a8187))


### Features

* **abstractions:** add custom kubernetes entity helper ([c62619f](https://github.com/buehler/dotnet-operator-sdk/commit/c62619fa4d2996fda991b687606e64b70692d0cc))
* add .net8 and allow .net6 in generator ([#670](https://github.com/buehler/dotnet-operator-sdk/issues/670)) ([ec43825](https://github.com/buehler/dotnet-operator-sdk/commit/ec43825c0957e163a17637e89e15d4c61c6c9edc)), closes [#641](https://github.com/buehler/dotnet-operator-sdk/issues/641) [#659](https://github.com/buehler/dotnet-operator-sdk/issues/659) [#633](https://github.com/buehler/dotnet-operator-sdk/issues/633)
* add runtime generated entity clients ([3b48147](https://github.com/buehler/dotnet-operator-sdk/commit/3b481478176eb05e22fd1a4fb7e4cf6734be05e9))
* **cli:** add certificate generator command ([#620](https://github.com/buehler/dotnet-operator-sdk/issues/620)) ([895a8d0](https://github.com/buehler/dotnet-operator-sdk/commit/895a8d012190396a08a172b5fd7350b31eedcb20))
* **cli:** add generate docker file command and optimize it ([fb06960](https://github.com/buehler/dotnet-operator-sdk/commit/fb06960f40cfd1c1779727c91e59333cf31b589b))
* **cli:** add generate operator command ([407d01a](https://github.com/buehler/dotnet-operator-sdk/commit/407d01a558bfc539076bbba61ed0f831ef39f1c2))
* **cli:** add operator role and role binding for rbac ([9a8c28c](https://github.com/buehler/dotnet-operator-sdk/commit/9a8c28c9a854a86a1cfdb6004a618ec3ce73eadd))
* **client:** add async/sync variants ([44df7e3](https://github.com/buehler/dotnet-operator-sdk/commit/44df7e3f9ca3939673ccbef1b4a426a35cb05e92))
* **client:** add create, update, delete methods for enumerable entities ([88cc35f](https://github.com/buehler/dotnet-operator-sdk/commit/88cc35f5d362251d5e5ec57718eabcd00433edd0))
* **client:** Add Kubernetes Client package ([0629746](https://github.com/buehler/dotnet-operator-sdk/commit/06297464bb721b17a3dfd220098074eb0f1965eb))
* **client:** Use true generics again ([#640](https://github.com/buehler/dotnet-operator-sdk/issues/640)) ([2154240](https://github.com/buehler/dotnet-operator-sdk/commit/2154240bd498d626e3605a5f65e7ca6055dd9831))
* **cli:** management install/uninstall commands ([#618](https://github.com/buehler/dotnet-operator-sdk/issues/618)) ([03cd894](https://github.com/buehler/dotnet-operator-sdk/commit/03cd894951e4726a29716d40e49cc1d126a07fee))
* **generator:** add controller registrations ([#623](https://github.com/buehler/dotnet-operator-sdk/issues/623)) ([1697d26](https://github.com/buehler/dotnet-operator-sdk/commit/1697d2616d21a7a0a94dd10f62e9890ce8415bf8))
* **generator:** generate entity initializer (static and partial) ([77458b6](https://github.com/buehler/dotnet-operator-sdk/commit/77458b60f95f14e18091af2ee8bbd52b4776b50d))
* **operator:** add better error handling and reconnection logic ([318541c](https://github.com/buehler/dotnet-operator-sdk/commit/318541c7d83184efb5988ad137b9eb564515cbbb))
* **operator:** add build targets extension for automatic resource generation ([7df5d48](https://github.com/buehler/dotnet-operator-sdk/commit/7df5d48dd345f1b6231817cffee15b51163bfc9d))
* **operator:** add leader election via KubernetesClient ([#627](https://github.com/buehler/dotnet-operator-sdk/issues/627)) ([d07ad0d](https://github.com/buehler/dotnet-operator-sdk/commit/d07ad0daa25fc31783fe6b96916137c8523494fe))
* **operator:** add namespaced operators ([b967f37](https://github.com/buehler/dotnet-operator-sdk/commit/b967f37bed582797490125c52d0f22d930534f3c))
* **operator:** register kubernetes client as transient ([154ba67](https://github.com/buehler/dotnet-operator-sdk/commit/154ba6774f5a4bad1448d866b7f808ba12eefc34))
* **operator:** reworked entity requeue logic ([3f6b862](https://github.com/buehler/dotnet-operator-sdk/commit/3f6b862e310fdf02254aadf9b1d15436572b4695))
* **transpiler:** allow metadata to be created from actual types. ([ef91bd1](https://github.com/buehler/dotnet-operator-sdk/commit/ef91bd17d6bc5725748f7d818a8624da66e8d6e4))
* upgrade KubernetesClient ([6896435](https://github.com/buehler/dotnet-operator-sdk/commit/6896435a6ee071ed42a5ef86f8dea6339a92625d))
* **web operator:** add localtunnel feature for easy webhook development. ([dbb3f85](https://github.com/buehler/dotnet-operator-sdk/commit/dbb3f858fc4cb5c12b5c2c9e58f9161b9645a803))
* **web-operator:** add conversion webhooks ([#639](https://github.com/buehler/dotnet-operator-sdk/issues/639)) ([6383a15](https://github.com/buehler/dotnet-operator-sdk/commit/6383a156a6ea8d0a6b67a84573554903694faf99)), closes [#137](https://github.com/buehler/dotnet-operator-sdk/issues/137)
* **web-operator:** Add validation webhooks. ([#631](https://github.com/buehler/dotnet-operator-sdk/issues/631)) ([92af569](https://github.com/buehler/dotnet-operator-sdk/commit/92af56992484806323d3963ee8a083d5807e7097))
* **webhook-generator:** add mutation webhook configs. ([c1e82d6](https://github.com/buehler/dotnet-operator-sdk/commit/c1e82d6be7d8585e443007e3e91b54f655788362))
* **webhook-generator:** only use operations that are overwritten. ([ad1e7ae](https://github.com/buehler/dotnet-operator-sdk/commit/ad1e7ae1db9b22f3f668cb699fc5bdb74e1cf383))
* **webhooks:** add mutation webhooks. ([5441d1e](https://github.com/buehler/dotnet-operator-sdk/commit/5441d1e75f9db34f686b940e1a68c7f12f686d60))
* **webhooks:** automatic installer generation for webhook operators ([#632](https://github.com/buehler/dotnet-operator-sdk/issues/632)) ([6ce343d](https://github.com/buehler/dotnet-operator-sdk/commit/6ce343d4117cc4a056e9709d8d9e2f37d317dd66))


### BREAKING CHANGES

* **web-operator:** The CLI (which broke anyway...) does now
generate everyting together and determines based on the
project if there are webhooks or not. This results in one
config folder instead of separate folders for CRD, RBAC, etc.
With this, conversion webhooks can inject their configuration
into the CRDs. Otherwise, this would be a cumbersome process.
If the need for single topic generation arises again (for example only CRDs),
then these generators can be added again.
* **webhooks:** This overhauls the mutation webhooks.
Use the documentation to see how they work.
It is similar to validation webhooks, but with
changed results.

Signed-off-by: Christoph Bühler <cbuehler@rootd.ch>
* **webhooks:** Webhooks are not generated
via the custom command for webhooks, nor are they
automatically installed at runtime. For now, webhook
definitions, certificates, and services are created
at buildtime.
* **webhooks:** This removes the runtime exeuction
of the webhook registrar magic.
* **web-operator:** This overhauls the way
webhooks worked. Webhooks now run
with normal ASP.net ApiControllers.
To use a webhook, refer to the documentation.
Basically, create a subclass of the validation
webhook class and decorate it with the
correct validation attribute. Then, the
webhook will run. Other elements
like automatic install will follow this
preview release.
* **operator:** The targets file contains
other properties than before. Refer to the
documentation for explicit details.
* **operator:** the `IEventManager` is not part
of the operator anymore. To publish events, inject the
`EventPublisher` delegate and use it to publish
events on entities with reason and message.
The name of the events are not base32 encoded but
hex encoded sha512 values now.
* **operator:** controllers do not have
return values anymore. To requeue an entity,
use the `EntityRequeue<_>` delegate. When
an entity is requeued, the reconcile loop
is called after the timeout. If - during this
timeout - the entity is modified or deleted,
the timeout will be cancelled.
* **client:** all calls that were
async before are now sync. There are
async variants of all calls with the
Async suffix.

Signed-off-by: Christoph Bühler <cbuehler@rootd.ch>
* **finalizer:** Finalizers are registered
with an identifier now. The identifier is
generated by the KubeOps.Generator when used.
Finalizers are attached via EntityFinalizerAttacher<>
delegates that attach the finalizer to an entity.
* **client:** The IKubernetesClient interface
and implementation now require the TEntity typeparam
instead of each method providing one. The implementation
is instanced with EntityMetadata to allow the operator
to inject the clients for each entity.
* **cli:** This allows the operator
to create a valid selfsigned CA and server
certificate ad-hoc in the cluster when using
webhooks. Instead of generating the certificates
locally and using them as config-map in kustomize,
the operator can run the cli to generate the service
certificate.
* **cli:** The install / uninstall commands
now search for a project or solution file to parse the
CRDs from a solution or a project.
* generator commands
may define a csproj or sln file on where the
entities or other elements are located.
If no file is provided, the current directory
is searched and the command fails if none is found.
* This removes the entity and rbac conversion
from the operator package and extracts them into their own
`KubeOps.Transpiler` package. All static methods there
are used for transpilation of the entities and rbac attributes.
Additional logic for Lease, events and such will reside
in the CLI.
* This removes several features from the
7.x version. Required / missing features will
be added to the v8 again. As for the first
pre release, only the simple watcher and
reconciliation loop is present. No finalizer, events, leadership,
whatsoever is present in the library. The initial pre.0
release is meant to be the base for further implementations.
V8 will - hopefully - contain all required features again.
* The operator does not have commands
and command line executions packaged into the library.
A new dotnet tool is required for CRD generation and
other generators.
* All abstractions are extracted into
a KubeOps.Abstractions package.
* The operator is not required to have
ASP.net as default, it works with a normal console
host application as well.
* `master` is renamed to `main` and
maintenance and release branches are added.



'