【问题标题】:Error install istio in GKE = the server could not find the requested resource (post `gatewaies.networking.istio.io`)在 GKE 中安装 istio 时出错 = 服务器找不到请求的资源(发布 `gatewaies.networking.istio.io`)
【发布时间】:2019-05-09 06:33:21
【问题描述】:

在 GKE 中安装 istio 时出现以下错误

kubernetes 版本 = 1.11.2-gke.18 Istio 版本 = 1.0.4 Kubectl = 来自 repo google 的最新消息

Error from server (NotFound): error when creating 
"`install/kubernetes/istio-demo-auth.yaml`": 
the server could not find the requested resource
(post `gatewaies.networking.istio.io`)

我尝试按照 GCP 上的教程进行操作: https://cloud.google.com/kubernetes-engine/docs/tutorials/installing-istio

【问题讨论】:

  • 我尝试了 GCP tutorial 与您一样使用与 1.11.2-gke.18 相同版本的 GKE 和 Node 用于 Istio。我使用的是 Istio 1.0.4 版。它无缝地为我工作。我建议您在 Kubernetes Engine 下的 Public Issue Tracker 提交缺陷报告,以便进行详细调查。这是提交缺陷报告的URL

标签: kubernetes google-cloud-platform google-kubernetes-engine istio


【解决方案1】:

您缺少 istio 所需的 CustomResourceDefinition,因此出现此错误。您需要从 istio 文件夹应用以下命令:

kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml

这将创建所有的 CRD,例如 virtualservice、destinationrules 等。

尝试按照 Istio 的官方文档在 GKE 上安装它:

https://istio.io/docs/setup/kubernetes/quick-start-gke-dm/

【讨论】:

  • 我试了一下,还是报错 kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml bla bla bla ... kubectl apply -f install/kubernetes/istio-demo-auth .yaml kubernetes "attributes" 配置了destinationrule "istio-policy" 配置了destinationrule "istio-telemetry" 配置了来自服务器的错误(NotFound):创建"install/kubernetes/istio-demo-auth.yaml" 时出错:服务器找不到请求的资源(发布gatewayes.networking.istio.io)
【解决方案2】:

我在安装自定义 Istio helm chart 时也遇到了这个问题:

[tiller] 2019/11/15 21:50:52 failed install perform step: release test failed: the server could not find the requested resource (post gatewaies.networking.istio.io)

我已确认 Istio CRD 已正确安装。请注意已安装的 Gateway CRD 如何明确注明接受的复数名称:

status:
  acceptedNames:
    categories:
    - istio-io
    - networking-istio-io
    kind: Gateway
    listKind: GatewayList
    plural: gateways
    shortNames:
    - gw
    singular: gateway

我创建了一个issue on Helm 来查看是否是罪魁祸首,否则,我可以在 Istio 上打开一个问题来查看是否是罪魁祸首。我很困惑这个问题的根源可能来自哪里。

**注意:**网关资源的类型正确:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway

【讨论】:

    【解决方案3】:

    istio 通过定义一系列 crds(Custom Resource Definition) 来工作,要让 istio 工作,首先需要运行如下命令:

    kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml

    对于我的版本(istio v1.2.0),命令是

    for i 在 install/kubernetes/helm/istio-init/files/crd*yaml;做 kubectl apply -f $i;完成

    但是当我按照文档中的说明进行操作时,我仍然会收到烦人的消息:

    Error from server (NotFound): error when creating "samples/bookinfo/networking/bookinfo-gateway.yaml": the server could not find the requested resource (post gatewaies.networking.istio.io)
    

    如提示所示,找不到请求的资源“gatewayes.networking.istio.io”,然后我列出了crds:

    kubectl 获取 crd

    我得到了一个这样的列表: enter image description here

    当我看到检查这个时,我发现有问题。 kubectl 发出的消息是 (post gateways.networking.istio.io),但是登记的 crd 是 post gateways.networking.istio.io,那么一切都清楚了,kubectl CLI 发出了错误的“gateway”复数,正确的形式是 gateways,而不是 gateways,所以为了满足命令形式,crd 必须改变。 我编辑了这个文件:

    vim install/kubernetes/helm/istio-init/files/crd-10.yaml

    通过将名称从“gateways.networking.istio.io”更改为“gatewayes.networking.istio.io”,现在一切正常。

    【讨论】:

    • 更改 CRD 似乎有点老套和不安全,尤其是如果它不是问题的罪魁祸首?
    猜你喜欢
    • 2020-01-24
    • 2021-05-10
    • 1970-01-01
    • 1970-01-01
    • 2019-01-11
    • 1970-01-01
    • 1970-01-01
    • 2017-01-07
    • 2018-05-14
    相关资源
    最近更新 更多