Reputation: 21
koko@henqiangmafanrangyirang operator % operator-sdk create api --group prom.my.domain --version v1beta1 --kind Prom
Create Resource [y/n]
y
Create Controller [y/n]
y
Error: failed to create API with "go.kubebuilder.io/v3": multiple groups are not allowed by default, to enable multi-group visit https://kubebuilder.io/migration/multi-group.html
----------
koko@henqiangmafanrangyirang operator % operator-sdk create api --group batch --version v1 --kind Prom
Create Resource [y/n]
y
Create Controller [y/n]
y
Error: failed to create API with "go.kubebuilder.io/v3": multiple groups are not allowed by default, to enable multi-group visit https://kubebuilder.io/migration/multi-group.html
------
koko@henqiangmafanrangyirang ~ % operator-sdk version
operator-sdk version: "v1.5.0", commit: "98f30d59ade2d911a7a8c76f0169a7de0dec37a0", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "darwin", GOARCH: "amd64"
Why failed to create? Although it tells me that I cannot customize, I still failed to use the group【batch】 of k8s, What should I do
Upvotes: 2
Views: 1001
Reputation: 454
I think you are trying for the same group, and not a different group.
Try the below command
operator-sdk create api --group prom --version v1beta1 --kind Prom
I just removed ".my.domain" from your command, This should work, Thanks
Upvotes: 0
Reputation: 663
The error message seemed clear to me, and suggested this doc, which is correct. https://kubebuilder.io/migration/multi-group.html
If the error wasnt clear to you, could you file an issue with kubebuilder? (golang operators using operator-sdk use kubebuilder under the hood)
Upvotes: 0