无法在 kubernetes 类型中安装 CRD
·
回答问题
我正在设置一个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"
Answers
您在这里看到的问题与种类无关,而是您尝试应用的清单使用过时的 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之类的东西应该可以工作。
更多推荐
所有评论(0)