The KubeOps CLI is a command-line tool designed to simplify the development and management of Kubernetes Operators using .NET. It provides utilities for generating Custom Resource Definitions (CRDs) and managing operator-related tasks.
To install the KubeOps CLI globally on your machine:
dotnet tool install --global KubeOps.CliTo install the KubeOps CLI locally in your project:
dotnet new tool-manifestdotnet tool install --local KubeOps.CliGenerates Custom Resource Definitions (CRDs) and other Kubernetes-related resources for your operator.
kubeops generateThe generate operator command creates all necessary resources for deploying your operator to Kubernetes:
- RBAC Rules: Role-based access control configurations
- Dockerfile: Container image definition for your operator
- Deployment: Kubernetes deployment configuration
- CRDs: Custom Resource Definitions based on your C# entities
- Namespace: A dedicated namespace for your operator
- Kustomization: Kustomize configuration for managing all resources
If your operator includes webhooks (mutations or validations), additional resources are generated:
- CA and Server Certificates: For secure webhook communication
- Webhook Configurations: For validation and mutation webhooks
- Service: For exposing webhook endpoints
- Secret Generators: For managing webhook certificates
Installs the operator and its CRDs into a Kubernetes cluster.
kubeops installRemoves the operator and its CRDs from a Kubernetes cluster.
kubeops uninstallDisplays the current version of the KubeOps CLI.
kubeops versionAll commands support the following global options:
--no-ansi: Disable ANSI colored output. This is automatically enabled when running in CI/CD environments (GitHub Actions, Azure Pipelines, Jenkins, GitLab CI, etc.)--forceor-f: Skip confirmation prompts--project: Regex pattern to filter projects in a solution--target-framework: Specify target framework for solution projects
The KubeOps CLI is designed to be used within .NET projects that implement Kubernetes operators. It helps streamline the development process by automating common tasks such as CRD generation and operator deployment.
For more detailed information about each command, use the --help flag:
kubeops [command] --help