首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >入口资源文件错误aks-spec.rules[0].http.paths[0].pathType:必需值:必须指定pathType

入口资源文件错误aks-spec.rules[0].http.paths[0].pathType:必需值:必须指定pathType
EN

Stack Overflow用户
提问于 2022-05-14 20:33:25
回答 1查看 1.9K关注 0票数 0

我正在跟踪MS文档来创建ingress控制器。

代码语言:javascript
运行
复制
https://learn.microsoft.com/en-us/learn/modules/aks-workshop/07-deploy-ingress

但是下面的yaml文件给了我错误:The Ingress "ratings-web-ingress" is invalid: spec.rules[0].http.paths[0].pathType: Required value: pathType must be specified

命令:kubectl apply --namespace ratingsapp -f ratings-web-ingress.yaml --validate=false

代码语言:javascript
运行
复制
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ratings-web-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - host: frontend.20-83-140-186.nip.io # IMPORTANT: update <ingress ip> with the dashed public IP of your ingress, for example frontend.13-68-177-68.nip.io
    http:
      paths:
      - path: /
      pathType: Prefix
      backend:
      service:
      name: ratings-web
      port:
      number: 80
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-16 09:03:58

我尝试用相同的代码复制创建入口NGINX控制器,并得到了相同的错误

要解决错误"spec.rules.http.paths.pathType:必需值: pathType必须指定“在pathType后替换pathType,如下所示:

代码语言:javascript
运行
复制
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ratings-web-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - host: frontend.10.0.0.1.nip.io # IMPORTANT: update <ingress ip> with the dashed public IP of your ingress, for example frontend.13-68-177-68.nip.io
    http:
      paths:
      - backend:
          service:
            name: ratings-web
            port:
              number: 80
        path: /
        pathType: ImplementationSpecific

修改yaml文件后,我成功地创建了入口:

有关更多细节,请参考下面的链接

Lab10.1 -创建入口规则错误:“必须指定pathType”-论坛

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

https://stackoverflow.com/questions/72243670

复制
相关文章

相似问题

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