首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >kind"gateway“和"virtualservice”没有匹配

kind"gateway“和"virtualservice”没有匹配
EN

Stack Overflow用户
提问于 2021-10-06 07:31:04
回答 1查看 711关注 0票数 1

我使用的是Docker Desktop版本3.6.0,其中包含Kubernetes 1.21.3。

我将按照本教程开始使用Istio

https://istio.io/latest/docs/setup/getting-started/

Istio已按照说明正确安装。

现在,每当我尝试应用Istio配置时

通过发出命令kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml

我得到以下错误

代码语言:javascript
复制
unable to recognize "samples/bookinfo/networking/bookinfo-gateway.yaml": no matches for kind "Gateway" in version "networking.istio.io/v1alpha3"
unable to recognize "samples/bookinfo/networking/bookinfo-gateway.yaml": no matches for kind "VirtualService" in version "networking.istio.io/v1alpha3"

我上网查了一下,发现网关和VirtualService资源都不见了。

如果执行kubectl get crd,则找不到任何资源

bookinfo-gatway.yaml的内容

代码语言:javascript
复制
    apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: bookinfo-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: bookinfo
spec:
  hosts:
  - "*"
  gateways:
  - bookinfo-gateway
  http:
  - match:
    - uri:
        exact: /productpage
    - uri:
        prefix: /static
    - uri:
        exact: /login
    - uri:
        exact: /logout
    - uri:
        prefix: /api/v1/products
    route:
    - destination:
        host: productpage
        port:
          number: 9080
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-06 13:05:28

istio的CRD应该作为istioctl安装过程的一部分进行安装,如果您没有可用的CRD,我建议您重新运行安装。

代码语言:javascript
复制
>>> ~/.istioctl/bin/istioctl install --set profile=demo -y
✔ Istio core installed
✔ Istiod installed
✔ Egress gateways installed
✔ Ingress gateways installed
✔ Installation complete

kubectl get po -n istio-system应该如下所示

代码语言:javascript
复制
>>> kubectl get po -n istio-system
NAME                                   READY   STATUS    RESTARTS   AGE
istio-egressgateway-7ddb45fcdf-ctnp5   1/1     Running   0          3m20s
istio-ingressgateway-f7cdcd7dc-zdqhg   1/1     Running   0          3m20s
istiod-788ff675dd-9p75l                1/1     Running   0          3m32s

否则,您的初始安装就会在某个地方出错。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69461513

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档