apiextensions-apiserver: Plural name for CRD doesn't work with kubectl
My CRD for Elasticsearch
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
labels:
app: kubedb
name: elasticsearches.kubedb.com
spec:
group: kubedb.com
names:
kind: Elasticsearch
listKind: ElasticsearchList
plural: elasticsearches
shortNames:
- es
singular: elasticsearch
scope: Namespaced
version: v1alpha1
status:
acceptedNames:
kind: Elasticsearch
listKind: ElasticsearchList
plural: elasticsearches
shortNames:
- es
singular: elasticsearch
conditions:
- lastTransitionTime: null
message: no conflicts found
reason: NoConflicts
status: "True"
type: NamesAccepted
- lastTransitionTime: 2017-08-31T07:10:38Z
message: the initial names have been accepted
reason: InitialNamesAccepted
status: "True"
type: Established
None of the following commands is working
$ kubectl get elasticsearch
Error from server (NotFound): Unable to list "elasticsearchs": the server could not find the requested resource (get elasticsearchs.kubedb.com)
kubectl get elasticsearches
the server doesn't have a resource type "elasticsearches"
kubectl get es
the server doesn't have a resource type "elasticsearches"
But I got correct SelfLink
/apis/kubedb.com/v1alpha1/elasticsearches
Here, I have used elasticsearches as plural form of elasticsearch.
How can I fix this and use elasticsearches as plural for kind Elasticsearch?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (9 by maintainers)
@frankgreco The fix is present in 1.7.8: https://github.com/kubernetes/kubernetes/blob/v1.7.8/staging/src/k8s.io/apimachinery/pkg/api/meta/restmapper.go. ๐
However,
k8s.io/apiextensions-apiserveris not upto date. The bot required to synck8s.io/apiextensions-apiserverwithkubernetes/kubernetesis currently being fixed now. Should be fixed soon afaik.@frankgreco Sounds perfect! ๐
Awesome, so if I understand correctly, the steps that would need to be completed before this is working e2e in my cluster would be:
kubernetes/kubernetesrepo to be synced with bothkubernetes/apimachineryandkubernetes/client-go@release-4.0kubernetes/apiextensions-server@release-1.7will need to update itโs dependencies so that it is using the fixed version ofkubernetes/apimachineryfrom the previous step.kubernetes/kuberneteswill need to be cut so that kubernetes/kubernetes#52545 is reflected.1.7.newand then everything should work.