use*_*285 0 nginx azure azure-aks
我按照 MS 文档创建入口 NGINX 控制器
https://learn.microsoft.com/en-us/learn/modules/aks-workshop/07-deploy-ingress
Run Code Online (Sandbox Code Playgroud)
但下面的 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
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
Run Code Online (Sandbox Code Playgroud)
我尝试使用相同的代码重现创建入口 NGINX 控制器并得到相同的错误:
\n\n要解决错误“ spec.rules[0].http.paths[0].pathType:必需值:必须指定pathType ”,请替换pathType: ImplementationSpecific如下pathType所示:
apiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n name: ratings-web-ingress\n annotations:\n kubernetes.io/ingress.class: nginx\nspec:\n rules:\n - 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\n http:\n paths:\n - backend:\n service:\n name: ratings-web\n port:\n number: 80\n path: /\n pathType: ImplementationSpecific\nRun Code Online (Sandbox Code Playgroud)\n修改yaml文件后,我能够成功创建ingress:
\n\n更详细的内容请参考以下链接:
\nLab10.1 - 创建入口规则时出错:“必须指定路径类型”\xe2\x80\x94 Linux 基金会论坛
\n| 归档时间: |
|
| 查看次数: |
6515 次 |
| 最近记录: |