Skip to content

Commit b3d7f70

Browse files
authored
docs: Correct kubeops CLI usage examples (#991)
Remove `dotnet` from `KubeOpsCli` command in `KubeOps.Operator.targets`. ## References - #988 (comment)
1 parent 454aa11 commit b3d7f70

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The documentation is also provided within the code itself (description of method
1818
- **Controller Logic:** Implement reconciliation logic using the `IEntityController<TEntity>` interface.
1919
- **Finalizers:** Easily add cleanup logic before resource deletion with `IEntityFinalizer<TEntity>`.
2020
- **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.
21-
- **Code Generation:** Includes Roslyn source generators and a CLI tool (`dotnet kubeops`) to automate boilerplate code for CRDs, controllers, and RBAC rules.
21+
- **Code Generation:** Includes Roslyn source generators and a CLI tool (`kubeops`) to automate boilerplate code for CRDs, controllers, and RBAC rules.
2222
- **Enhanced Kubernetes Client:** Provides convenience methods built on top of the official client library.
2323
- **Leader Election:** Automatic handling for high-availability operator deployments.
2424

docs/docs/operator/cli.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ During local development, you'll primarily use the `install` and `uninstall` com
3232
To install your operator's CRDs into your development cluster:
3333

3434
```bash
35-
dotnet kubeops install ./MyOperator.csproj
35+
kubeops install ./MyOperator.csproj
3636
```
3737

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

5252
```bash
53-
dotnet kubeops uninstall ./MyOperator.csproj
53+
kubeops uninstall ./MyOperator.csproj
5454
```
5555

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

6666
```bash
67-
dotnet kubeops generate operator MyOperator ./MyOperator.csproj
67+
kubeops generate operator MyOperator ./MyOperator.csproj
6868
```
6969

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

8787
```bash
88-
dotnet kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
88+
kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
8989
```
9090

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

103103
```bash
104-
dotnet kubeops api-version
104+
kubeops api-version
105105
```
106106

107107
This displays:
@@ -133,24 +133,24 @@ All commands support these options:
133133

134134
```bash
135135
# Install CRDs for development
136-
dotnet kubeops install ./MyOperator.csproj
136+
kubeops install ./MyOperator.csproj
137137

138138
# Generate resources for deployment
139-
dotnet kubeops generate operator MyOperator ./MyOperator.csproj
139+
kubeops generate operator MyOperator ./MyOperator.csproj
140140
```
141141

142142
2. **Testing Different Versions**:
143143

144144
```bash
145145
# Uninstall current version
146-
dotnet kubeops uninstall ./MyOperator.csproj
146+
kubeops uninstall ./MyOperator.csproj
147147

148148
# Install new version
149-
dotnet kubeops install ./MyOperator.csproj
149+
kubeops install ./MyOperator.csproj
150150
```
151151

152152
3. **Custom Resource Generation**:
153153
```bash
154154
# Generate resources with custom output
155-
dotnet kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
155+
kubeops generate operator MyOperator ./MyOperator.csproj --out ./k8s --format yaml
156156
```

docs/docs/operator/getting-started.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The CLI provides several useful commands:
7575
Generate all necessary Kubernetes resources for your operator:
7676

7777
```bash
78-
dotnet kubeops generate operator MyOperator ./MyFirstOperator.csproj
78+
kubeops generate operator MyOperator ./MyFirstOperator.csproj
7979
```
8080

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

109109
```bash
110-
dotnet kubeops install ./MyFirstOperator.csproj
110+
kubeops install ./MyFirstOperator.csproj
111111
```
112112

113113
### Uninstall CRDs
114114

115115
Remove your operator's CRDs from the cluster:
116116

117117
```bash
118-
dotnet kubeops uninstall ./MyFirstOperator.csproj
118+
kubeops uninstall ./MyFirstOperator.csproj
119119
```
120120

121121
## Building Blocks of an Operator

src/KubeOps.Cli/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dotnet tool install --local KubeOps.Cli
3434
Generates Custom Resource Definitions (CRDs) and other Kubernetes-related resources for your operator.
3535

3636
```bash
37-
dotnet kubeops generate
37+
kubeops generate
3838
```
3939

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

6060
```bash
61-
dotnet kubeops install
61+
kubeops install
6262
```
6363

6464
### Uninstall
6565

6666
Removes the operator and its CRDs from a Kubernetes cluster.
6767

6868
```bash
69-
dotnet kubeops uninstall
69+
kubeops uninstall
7070
```
7171

7272
### Version
7373

7474
Displays the current version of the KubeOps CLI.
7575

7676
```bash
77-
dotnet kubeops version
77+
kubeops version
7878
```
7979

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

8686
```bash
87-
dotnet kubeops [command] --help
87+
kubeops [command] --help
8888
```

src/KubeOps.Operator/Build/KubeOps.Operator.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Target Name="BaseConfig">
33
<PropertyGroup>
44
<OperatorName Condition="'$(OperatorName)' == ''">$(AssemblyName.ToLowerInvariant())</OperatorName>
5-
<KubeOpsCli Condition="'$(KubeOpsCli)' == ''">dotnet kubeops</KubeOpsCli>
5+
<KubeOpsCli Condition="'$(KubeOpsCli)' == ''">kubeops</KubeOpsCli>
66
<KubeOpsConfigOut Condition="'$(KubeOpsConfigOut)' == ''">$(MSBuildProjectDirectory)\config</KubeOpsConfigOut>
77
<GenerateOperatorResources Condition="'$(GenerateOperatorResources)' == '' And '$(Configuration)' == 'Release'">true</GenerateOperatorResources>
88
</PropertyGroup>

src/KubeOps.Transpiler/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ foreach (var crd in crds)
9393

9494
### Use Cases
9595

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

100-
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.
100+
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.
101101

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

0 commit comments

Comments
 (0)