无法安装 kubernetes 类型的 CRD

pka*_*mol 16 kubernetes kind

我正在设置一个kind集群

\n
Creating cluster "kind" ...\n \xe2\x9c\x93 Ensuring node image (kindest/node:v1.22.1)  \n \xe2\x9c\x93 Preparing nodes    \n \xe2\x9c\x93 Writing configuration  \n \xe2\x9c\x93 Starting control-plane \xef\xb8\x8f \n \xe2\x9c\x93 Installing CNI  \n \xe2\x9c\x93 Installing StorageClass  \n \xe2\x9c\x93 Joining worker nodes  \n \xe2\x9c\x93 Waiting \xe2\x89\xa4 5m0s for control-plane = Ready \xe2\x8f\xb3 \n \xe2\x80\xa2 Ready after 0s \n
Run Code Online (Sandbox Code Playgroud)\n

然后尝试按照版本 1.6 的说明安装 ECK 运算符

\n
kubectl apply -f https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml\n
Run Code Online (Sandbox Code Playgroud)\n

但是该过程失败了,好像kind不支持 CRD...是这样吗?

\n
namespace/elastic-system created\nserviceaccount/elastic-operator created\nsecret/elastic-webhook-server-cert created\nconfigmap/elastic-operator created\nclusterrole.rbac.authorization.k8s.io/elastic-operator created\nclusterrole.rbac.authorization.k8s.io/elastic-operator-view created\nclusterrole.rbac.authorization.k8s.io/elastic-operator-edit created\nclusterrolebinding.rbac.authorization.k8s.io/elastic-operator created\nservice/elastic-webhook-server created\nstatefulset.apps/elastic-operator created\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"\nunable to recognize "https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml": no matches for kind "ValidatingWebhookConfiguration" in version "admissionregistration.k8s.io/v1beta1"\n
Run Code Online (Sandbox Code Playgroud)\n

Ror*_*une 32

您在这里看到的问题与种类无关,而是您尝试应用的清单正在使用过时的 API 版本,这些版本已在 Kubernetes 1.22 中删除

具体来说,清单使用 v1beta1 版本的 customresourcedefinition 对象和 validatingadmissionwebhook 对象

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
Run Code Online (Sandbox Code Playgroud)

正如本文所述,这是 1.22 发布时删除的版本之一。

有几个修复程序可以解决此问题。首先,您可以获得清单,只需更改 customresourcedefinitions 以使用新的 API 版本apiextensions.k8s.io/v1,并更改​​ validatingadmissionwebhook 以使用admissionregistration.k8s.io/v1.

另一个修复方法是使用旧版本的 Kubernetes。如果您使用 1.21 或更早版本,则不会出现该问题,因此类似的操作 kind create cluster --image=kindest/node:v1.21.2应该有效。