我正在按照 MS 檔案創建入口 NGINX 控制器
https://docs.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
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
uj5u.com熱心網友回復:
我嘗試使用相同的代碼重現創建入口 NGINX 控制器并得到相同的錯誤:
![入口資源檔案錯誤 AKS - spec.rules[0].http.paths[0].pathType:必需值:必須指定 pathType](https://img.uj5u.com/2022/05/18/b96d9e0131cc4cdd8a55b3008495bd81.png)
要解決錯誤“ spec.rules[0].http.paths[0].pathType:Required value: pathType must be specifiedpathType: ImplementationSpecific ”替換pathType如下:
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檔案后,我能夠成功創建入口:
![入口資源檔案錯誤 AKS - spec.rules[0].http.paths[0].pathType:必需值:必須指定 pathType](https://img.uj5u.com/2022/05/18/038ff807b737426ebcf0cbe1d02b51b2.png)
更多詳情,請參考以下鏈接:
Lab10.1 - 創建入口規則時出錯:“必須指定路徑型別” — Linux 基金會論壇
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/476739.html
下一篇:如何從PC解壓縮zip檔案
