mirror of https://github.com/rancher/turtles.git
Signed-off-by: Andrea Mazzotti <andrea.mazzotti@suse.com> |
||
|---|---|---|
| .. | ||
| applications | ||
| clusterclasses | ||
| clusters/docker/rke2 | ||
| legacy | ||
| README.md | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
README.md
Examples CLI Tool
This CLI tool is designed to extract and apply cluster class examples.
Usage
From the examples/ directory, configure the go workspace and download the dependencies:
go work use ./
go mod download
Run the program with:
go run main.go <search_key>
<search_key>: The key to search for in the available cluster classes. In case of an incorrect ClusterClass key used, the closest matching key will be suggested.
Flags
-l,--list: List available cluster class names from examples.-r,--regex: ClusterClass search regex.
Examples
List available cluster classes
go run main.go -l
Example output:
Available classes: [azure-aks-example azure-example azure-rke2-example]
Search for a specific cluster class
go run main.go azure-aks
Search for cluster classes using a regex
go run main.go -r "azure"
Note: Regex search can return multiple examples.
To apply the extracted examples, you can use the following command:
go run main.go <search_key> | kubectl apply -f -