Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The documentation is also provided within the code itself (description of method
- **Controller Logic:** Implement reconciliation logic using the `IEntityController<TEntity>` interface.
- **Finalizers:** Easily add cleanup logic before resource deletion with `IEntityFinalizer<TEntity>`.
- **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.
- **Code Generation:** Includes Roslyn source generators and a CLI tool (`dotnet kubeops`) to automate boilerplate code for CRDs, controllers, and RBAC rules.
- **Code Generation:** Includes Roslyn source generators and a CLI tool (`kubeops`) to automate boilerplate code for CRDs, controllers, and RBAC rules.
- **Enhanced Kubernetes Client:** Provides convenience methods built on top of the official client library.
- **Leader Election:** Automatic handling for high-availability operator deployments.

Expand Down
20 changes: 10 additions & 10 deletions docs/docs/operator/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ During local development, you'll primarily use the `install` and `uninstall` com
To install your operator's CRDs into your development cluster:

```bash
dotnet kubeops install ./MyOperator.csproj
kubeops install ./MyOperator.csproj
```

This command:
Expand All @@ -50,7 +50,7 @@ The `install` and `uninstall` commands are primarily intended for development pu
To remove your operator's CRDs from the development cluster:

```bash
dotnet kubeops uninstall ./MyOperator.csproj
kubeops uninstall ./MyOperator.csproj
```

This is useful when:
Expand All @@ -64,7 +64,7 @@ This is useful when:
The `generate` command creates all necessary Kubernetes resources for your operator:

```bash
dotnet kubeops generate operator MyOperator ./MyOperator.csproj
kubeops generate operator MyOperator ./MyOperator.csproj
```

This generates:
Expand All @@ -85,7 +85,7 @@ The resource generation is automatically included in the build process. You don'
The generate command supports several options:

```bash
dotnet kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
```

Common options:
Expand All @@ -101,7 +101,7 @@ Common options:
The `version` command shows information about your current Kubernetes cluster:

```bash
dotnet kubeops api-version
kubeops api-version
```

This displays:
Expand Down Expand Up @@ -133,24 +133,24 @@ All commands support these options:

```bash
# Install CRDs for development
dotnet kubeops install ./MyOperator.csproj
kubeops install ./MyOperator.csproj

# Generate resources for deployment
dotnet kubeops generate operator MyOperator ./MyOperator.csproj
kubeops generate operator MyOperator ./MyOperator.csproj
```

2. **Testing Different Versions**:

```bash
# Uninstall current version
dotnet kubeops uninstall ./MyOperator.csproj
kubeops uninstall ./MyOperator.csproj

# Install new version
dotnet kubeops install ./MyOperator.csproj
kubeops install ./MyOperator.csproj
```

3. **Custom Resource Generation**:
```bash
# Generate resources with custom output
dotnet kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
```
6 changes: 3 additions & 3 deletions docs/docs/operator/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The CLI provides several useful commands:
Generate all necessary Kubernetes resources for your operator:

```bash
dotnet kubeops generate operator MyOperator ./MyFirstOperator.csproj
kubeops generate operator MyOperator ./MyFirstOperator.csproj
```

:::note Automatic Generation
Expand Down Expand Up @@ -107,15 +107,15 @@ Make sure to handle these certificates securely in production environments.
Install your operator's CRDs into your Kubernetes cluster:

```bash
dotnet kubeops install ./MyFirstOperator.csproj
kubeops install ./MyFirstOperator.csproj
```

### Uninstall CRDs

Remove your operator's CRDs from the cluster:

```bash
dotnet kubeops uninstall ./MyFirstOperator.csproj
kubeops uninstall ./MyFirstOperator.csproj
```

## Building Blocks of an Operator
Expand Down
10 changes: 5 additions & 5 deletions src/KubeOps.Cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dotnet tool install --local KubeOps.Cli
Generates Custom Resource Definitions (CRDs) and other Kubernetes-related resources for your operator.

```bash
dotnet kubeops generate
kubeops generate
```

The `generate operator` command creates all necessary resources for deploying your operator to Kubernetes:
Expand All @@ -58,23 +58,23 @@ If your operator includes webhooks (mutations or validations), additional resour
Installs the operator and its CRDs into a Kubernetes cluster.

```bash
dotnet kubeops install
kubeops install
```

### Uninstall

Removes the operator and its CRDs from a Kubernetes cluster.

```bash
dotnet kubeops uninstall
kubeops uninstall
```

### Version

Displays the current version of the KubeOps CLI.

```bash
dotnet kubeops version
kubeops version
```

## Usage
Expand All @@ -84,5 +84,5 @@ The KubeOps CLI is designed to be used within .NET projects that implement Kuber
For more detailed information about each command, use the `--help` flag:

```bash
dotnet kubeops [command] --help
kubeops [command] --help
```
2 changes: 1 addition & 1 deletion src/KubeOps.Operator/Build/KubeOps.Operator.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Target Name="BaseConfig">
<PropertyGroup>
<OperatorName Condition="'$(OperatorName)' == ''">$(AssemblyName.ToLowerInvariant())</OperatorName>
<KubeOpsCli Condition="'$(KubeOpsCli)' == ''">dotnet kubeops</KubeOpsCli>
<KubeOpsCli Condition="'$(KubeOpsCli)' == ''">kubeops</KubeOpsCli>
<KubeOpsConfigOut Condition="'$(KubeOpsConfigOut)' == ''">$(MSBuildProjectDirectory)\config</KubeOpsConfigOut>
<GenerateOperatorResources Condition="'$(GenerateOperatorResources)' == '' And '$(Configuration)' == 'Release'">true</GenerateOperatorResources>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/KubeOps.Transpiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ foreach (var crd in crds)

### Use Cases

- **KubeOps CLI:** This package is the engine behind the `dotnet kubeops generate crd` command.
- **KubeOps CLI:** This package is the engine behind the `kubeops generate crd` command.
- **Custom Build Tasks:** Integrate CRD generation directly into your MSBuild process.
- **Schema Validation Tools:** Use the generated CRD schema for validating custom resource YAML files.

The assembly inspection and attribute processing logic within this package is also leveraged by the KubeOps CLI (`dotnet kubeops generate operator`) command. The CLI uses this package's capabilities to find types decorated with `[EntityRbac]` attributes when generating the RBAC manifests (`Role`/`ClusterRole`) for your operator.
The assembly inspection and attribute processing logic within this package is also leveraged by the KubeOps CLI (`kubeops generate operator`) command. The CLI uses this package's capabilities to find types decorated with `[EntityRbac]` attributes when generating the RBAC manifests (`Role`/`ClusterRole`) for your operator.

For more details on defining the C# classes themselves, see the main KubeOps documentation.