Istio CRD 安装失败

发布于 2025-01-18 09:54:18 字数 1592 浏览 5 评论 0原文

我正在尝试在我的 DO K8s 集群中安装 istio

我创建了一个空资源来下载 istio 并使用此示例运行 helm 图表 - https://mohsensy.github.io/sysadmin/2021/04/09/install-istio-with-terraform.html

TF 看起来像 -

resource "kubernetes_namespace" "istio_system" {
  metadata {
    name = "istio-system"
  }
}

resource "null_resource" "istio" {
  provisioner "local-exec" {
    command = <<EOF
      set -xe

      cd ${path.root}
      rm -rf ./istio-1.9.2 || true
      curl -sL https://istio.io/downloadIstio | ISTIO_VERSION=1.9.2 sh -
      rm -rf ./istio || true
      mv ./istio-1.9.2 istio
    EOF
  }

  triggers = {
    build_number = timestamp()
  }
}

resource "helm_release" "istio_base" {
  name = "istio-base"
  chart = "istio/manifests/charts/base"

  timeout = 120
  cleanup_on_fail = true
  force_update = true
  namespace = "istio-system"

  depends_on = [
    digitalocean_kubernetes_cluster.k8s_cluster,
    kubernetes_namespace.istio_system,
    null_resource.istio
  ]
}

我可以看到 istio图表与 CRD 一起下载。

│ Error: failed to install CRD crds/crd-all.gen.yaml: unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
│ 
│   with helm_release.istio_base,
│   on istio.tf line 32, in resource "helm_release" "istio_base":
│   32: resource "helm_release" "istio_base" {

我需要帮助来理解无法识别“”在这里所说的内容!

我正在寻找带有一些解释的解决方案。

I am attempting to install istio in my DO K8s cluster.

I have created a null resource to download istio and run the helm charts using this example - https://mohsensy.github.io/sysadmin/2021/04/09/install-istio-with-terraform.html

TF looks like -

resource "kubernetes_namespace" "istio_system" {
  metadata {
    name = "istio-system"
  }
}

resource "null_resource" "istio" {
  provisioner "local-exec" {
    command = <<EOF
      set -xe

      cd ${path.root}
      rm -rf ./istio-1.9.2 || true
      curl -sL https://istio.io/downloadIstio | ISTIO_VERSION=1.9.2 sh -
      rm -rf ./istio || true
      mv ./istio-1.9.2 istio
    EOF
  }

  triggers = {
    build_number = timestamp()
  }
}

resource "helm_release" "istio_base" {
  name = "istio-base"
  chart = "istio/manifests/charts/base"

  timeout = 120
  cleanup_on_fail = true
  force_update = true
  namespace = "istio-system"

  depends_on = [
    digitalocean_kubernetes_cluster.k8s_cluster,
    kubernetes_namespace.istio_system,
    null_resource.istio
  ]
}

I can see the istio charts are downloaded with the CRDs.

│ Error: failed to install CRD crds/crd-all.gen.yaml: unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
│ 
│   with helm_release.istio_base,
│   on istio.tf line 32, in resource "helm_release" "istio_base":
│   32: resource "helm_release" "istio_base" {

I need help in understanding what unable to recognize "" tells here!

I am looking for a resolution with some explanation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奢望 2025-01-25 09:54:18

错误正在尝试帮助您:

unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"

查看Kubernetes Enviornment中可用的API资源:

$ kubectl api-resources | grep CustomResourceDefinition

您可能会看到类似的内容:

customresourcedefinitions             crd,crds                               apiextensions.k8s.io/v1                        false        CustomResourceDefinition

在此处注意API版本:它是aspiextensions.k8s/io/io/v1 ,不是/v1beta1。您的清单是为Kubernetes较旧版本的。更改是您只需在正确值的清单中更改apiversion,它将起作用。

The error is trying to help you out:

unable to recognize "": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"

Take a look at the API resources available in your Kubernetes enviornment:

$ kubectl api-resources | grep CustomResourceDefinition

You will probably see something like:

customresourcedefinitions             crd,crds                               apiextensions.k8s.io/v1                        false        CustomResourceDefinition

Note the API version there: it's aspiextensions.k8s/io/v1, not /v1beta1. Your manifest was built for an older version of Kubernetes. Changes are you can just change the apiVersion in the manifest to the correct value and it will work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文