What did you do?
Create a new operator with kind Redis. Tried to create the CRD and then the CR.
What did you expect to see?
It should create both CRD and CR.
What did you see instead? Under which circumstances?
When we try to create the CR, It gave this error.
Error from server (NotFound): error when creating "deploy/crds/ice.example.com_v1_tests_cr.yaml": the server could not find the requested resource (post testses.ice.example.com)
When I tried to create using the same steps with name Redi instead of Redis it worked. I then tried for two more kinds Test and Tests and I got the same error with tests. So I can say that when ever the name of kind ends with an s, this error will come while creating the CR.
Environment
operator-sdk version: "v0.12.0", commit: "2445fcda834ca4b7cf0d6c38fba6317fb219b469", go version: "go1.13.4 darwin/amd64"
Kubernetes version information:
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.6", GitCommit:"4bc5e7f9a6c25dc4c03d4d656f2cefd21540e28c", GitTreeState:"clean", BuildDate:"2017-09-15T08:51:09Z", GoVersion:"go1.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-09-18T20:30:29Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Kubernetes cluster kind:
Minikube
Are you writing your operator in ansible, helm, or go?
Go
Possible Solution
Where ever the name for this plural part is generated it has to do proper plural for kind which ends withs
Additional context
Steps followed.
operator-sdk new redis-operator
operator-sdk add api --api-version=ice.example.com/v1 --kind=Tests
kubectl apply -f deploy/crds/ice.example.com_tests_crd.yaml
kubectl apply -f deploy/crds/ice.example.com_v1_tests_cr.yaml
Got below error: Error from server (NotFound): error when creating "deploy/crds/ice.example.com_v1_tests_cr.yaml": the server could not find the requested resource (post testses.ice.example.com)
When I tried the same with name kind = Test it worked properly.
Hi @chowmean,
As I described in https://github.com/operator-framework/operator-sdk/issues/2371#issuecomment-572159050 I used the same data/input Kind=Redis and all was generated and worked well in the k8s.
I am looking at your k8s version. It shows not supportable any more. You need to use a k8s version 1.14+. Could you please check it? I think it is the root cause of your issue.
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-09-18T20:30:29Z", GoVersion:"go1.8.3",
Tried with operator-sdk version: v.0.13 and Kubernetes: v1.7.5
Still the same error.
HI @chowmean,
I am unable to reproduce the issue with the data gen by the SDK and using k8s 1.14+.
Could you please verify your local env ( versions and configuration )? See that your k8s is old and using a very old version of go when it should be using 1.13+ as well.
If you still facing the issue after that, could you please add here the Environment data used?
Hi @chowmean,
I have checked on mini-kube and the issue does not replicate.
My version were:-
kubernetes:- v1.17.0
Docker:-v19.03.5
go:-v1.13.5
Thanks, @theSupermacy, the problem seems like with Kubernetes older version. Closing this issue.
Most helpful comment
Thanks, @theSupermacy, the problem seems like with Kubernetes older version. Closing this issue.