kubernetes - 无法在 kubernetes 类型中安装 CRD

标签 kubernetes kind

我正在设置一个 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 💚
然后尝试按照 instructions 安装 ECK 运算符关于 1.6 版
kubectl apply -f https://download.elastic.co/downloads/eck/1.6.0/all-in-one.yaml
但是进程失败了,好像kind不支持 CRD...是这种情况吗?
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"

最佳答案

您在此处看到的问题与种类无关,而是您尝试应用的 list 使用的是过时的 API 版本,这些版本已在 Kubernetes 1.22 中删除
具体来说, list 使用的是 v1beta1 版本的 customresourcedefinition 对象和 validatingadmissionwebhook 对象

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
this post 中所述那是 1.22 进入时删除的版本之一。
对此有一些修复。首先,您可以获取 list 并更改自定义资源定义以使用新的 API 版本 apiextensions.k8s.io/v1并验证admissionwebhook 使用admissionregistration.k8s.io/v1 .
另一个修复方法是使用旧版本的 Kubernetes。如果您使用 1.21 或更早版本,则不应发生该问题,因此类似于 kind create cluster --image=kindest/node:v1.21.2应该管用。

关于kubernetes - 无法在 kubernetes 类型中安装 CRD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69054622/

相关文章:

nginx - 无法通过高级网络在 AKS 中获取真正的远程 IP

kubernetes - Nginx-ingress 上的默认证书

kubernetes - 如何使用Kubernetes在GCP中扩展Webapp

kubernetes - 种类和 kubectl : The connection to the server localhost:8080 was refused - did you specify the right host or port?

kubernetes - 由于证书 mTLS 上的路径无效,Istio Sidecar 代理无法启动

kubernetes - Apache Ignite:日志中添加了数千条 “Unable to perform handshake within timeout”警告

kubernetes - 删除 Kubernetes 就绪探针

kubernetes - 由于未初始化CNI插件,Kubernetes worker 节点未就绪

docker - 使用KinD创建本地集群,CPU保持高使用率