5

我正在建立一个kind集群

Creating cluster "kind" ...
 ✓ Ensuring node image (kindest/node:v1.22.1)  
 ✓ Preparing nodes    
 ✓ Writing configuration  
 ✓ Starting control-plane ️ 
 ✓ Installing CNI  
 ✓ Installing StorageClass  
 ✓ Joining worker nodes  
 ✓ Waiting ≤ 5m0s for control-plane = Ready ⏳ 
 • Ready after 0s 

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

kubectl apply -f https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml

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

namespace/elastic-system created
serviceaccount/elastic-operator created
secret/elastic-webhook-server-cert created
configmap/elastic-operator created
clusterrole.rbac.authorization.k8s.io/elastic-operator created
clusterrole.rbac.authorization.k8s.io/elastic-operator-view created
clusterrole.rbac.authorization.k8s.io/elastic-operator-edit created
clusterrolebinding.rbac.authorization.k8s.io/elastic-operator created
service/elastic-webhook-server created
statefulset.apps/elastic-operator created
unable 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"
unable 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"
unable 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"
unable 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"
unable 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"
unable 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"
unable 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"
unable 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"
4

1 回答 1

14

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

具体来说,清单正在使用 customresourcedefinition 对象和验证 admissionwebhook 对象的 v1beta1 版本

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition

如本文所述,是 1.22 推出时删除的版本之一。

对此有几个修复。首先,您可以获得清单,只需更改 customresourcedefinitions 以使用新的 API 版本apiextensions.k8s.io/v1并验证 admissionwebhook 以使用admissionregistration.k8s.io/v1.

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

于 2021-09-04T11:12:32.553 回答