Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add new CRDs #606

Closed
vitorguidi opened this issue Jan 11, 2024 · 4 comments
Closed

How to add new CRDs #606

vitorguidi opened this issue Jan 11, 2024 · 4 comments
Labels
done Issues in the state 'done'

Comments

@vitorguidi
Copy link

I want to play around with this project and experiment with vertical autoscaling. Having said that, I looked through the makefile and did not find a way to add a new API.

As this project is bootstraped with kubebuilder, I attempted to run the following command, and got a bad result:

`
vitor@Pato:~/projects/cass-operator$ kubebuilder create api --group cassandra.datastax.com --version v1beta1 --kind cassandradatacenterautoscaler
Error: no plugin could be resolved with key "go.kubebuilder.io/v4-alpha" for project version "3" (plugin version is unstable, there may be an upgrade available: https://kubebuilder.io/migration/plugin/plugins.html)
Usage:
kubebuilder [flags]

Examples:
The first step is to initialize your project:
kubebuilder init [--plugins= [--project-version=]]

is a comma-separated list of plugin keys from the following table
and a supported project version for these plugins.

                         Plugin keys | Supported project versions

-----------------------------------------+----------------------------
base.go.kubebuilder.io/v3 | 3
base.go.kubebuilder.io/v4 | 3
declarative.go.kubebuilder.io/v1 | 2, 3
deploy-image.go.kubebuilder.io/v1-alpha | 3
go.kubebuilder.io/v2 | 2, 3
go.kubebuilder.io/v3 | 3
go.kubebuilder.io/v4 | 3
grafana.kubebuilder.io/v1-alpha | 3
kustomize.common.kubebuilder.io/v1 | 3
kustomize.common.kubebuilder.io/v2 | 3

For more specific help for the init command of a certain plugins and project version
configuration please run:
kubebuilder init --help --plugins= [--project-version=]

Default plugin keys: "go.kubebuilder.io/v4"
Default project version: "3"

Flags:
-h, --help help for kubebuilder
--plugins strings plugin keys to be used for this subcommand execution
--project-version string project version (default "3")

FATA no plugin could be resolved with key "go.kubebuilder.io/v4-alpha" for project version "3" (plugin version is unstable, there may be an upgrade available: https://kubebuilder.io/migration/plugin/plugins.html)
`

What is the correct/expected way to go about creating new APIs/CRDs/controllers?

@burmanm
Copy link
Contributor

burmanm commented Jan 11, 2024

You can fix that issue by modifying the PROJECT file and moving from v4-alpha -> v4. After that, kubebuilder / operator-sdk should work.

@burmanm
Copy link
Contributor

burmanm commented Jan 11, 2024

Not that kubebuilder is needed, one can also add APIs by just creating correct files and modifying the PROJECT file.

@vitorguidi
Copy link
Author

vitorguidi commented Jan 15, 2024

Another way is to use operator-sdk 1.32, as the v4 thing is added in 1.33. Works as well, ended up figuring this one out before reading your reply.
This did the trick:
operator-sdk create api --group cassandra.datastax.com --version v1beta1 --kind CassandraDataCenterAutoscaler --resource --controller
Thanks!

@burmanm
Copy link
Contributor

burmanm commented Jul 12, 2024

Closing stale tickets, reopen if there's anything else.

@burmanm burmanm closed this as completed Jul 12, 2024
@adejanovski adejanovski added the done Issues in the state 'done' label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Issues in the state 'done'
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants