
A Rust-based plugin for the Operator SDK that helps you scaffold Kubernetes Operators with Rust. This project aims to simplify and enhance the development experience for Kubernetes operators written in Rust.
Features
- An Operator SDK plugin to enable scaffolding, building, and testing (coming soon) Kubernetes operators with Rust.
- Supports common Kubernetes resources like CRDs, and controllers.
- Customizable templates and scaffolding for different operator components.
- Designed with the goal of improving the developer experience for Rust developers in the Kubernetes ecosystem.
Why Rust?
Installation
Prerequisites
Ensure that you have the following installed on your system:
Installing the Plugin
To install this Rust Operator SDK plugin, use the following steps:
-
Clone the repository:
git clone https://github.com/SystemCraftsman/rust-operator-plugins.git
cd rust-operator-plugins
-
Initialize the Operator SDK within the project:
make configure-sdk
This fetches a required version of the Operator SDK, configures it for local development.
-
Build the plugin:
make build
This comamnd builds Operator SDK with the Rust Operator Plugin included.
-
Install the plugin (for local development):
make install
This installs an Operator SDK binary with the Rust Operator Plugin.
-
You should now be able to use the plugin with the Operator SDK CLI.
Usage
Once installed, you can use this plugin with the operator-sdk
command-line tool to initialize a new operator project
written in Rust.
Initialize a New Operator
Following is an example of initializing the operator in your <project_directory>
:
cd <project_directory>
operator-sdk init --plugins rust/v1alpha --domain <your-domain>
Create API and Controller Base
To create a new API with resources and the controllers scaffolded, you should run a command as follows:
operator-sdk create api --group <your-api-group> --version <api-version> --kind <crd-name> --resource --controller
Additionally, you can create the resource
and controller
with separate commands.