error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0])
[root@mbs01 k8s]# kubectl apply -f ingress-tomcat6.yamlerror: error validating “ingress-tomcat6.yaml”: error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0]): unknown field “serv
[root@mbs01 k8s]# kubectl apply -f ingress-tomcat6.yaml
error: error validating “ingress-tomcat6.yaml”: error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0]): unknown field “serviceName” in io.k8s.api.extensions.v1beta1.HTTPIngressPath, ValidationError(Ingress.spec.rules[0].http.paths[0]): unknown field “servicePort” in io.k8s.api.extensions.v1beta1.HTTPIngressPath, ValidationError(Ingress.spec.rules[0].http.paths[0]): missing required field “backend” in io.k8s.api.extensions.v1beta1.HTTPIngressPath]; if you choose to ignore these errors, turn validation off with --validate=false
[root@mbs01 k8s]# cat ingress-tomcat6.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: web
spec:
rules:
- host: tomcat6.mbs.com
http:
paths:
- backend:
serviceName: tomcat6
servicePort: 80
[root@mbs01 k8s]# cat ingress-tomcat6.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: web
spec:
rules: - host: tomcat6.mbs.com
http:
paths:
- backend:
serviceName: tomcat6
servicePort: 80
这个问题的出现在于配置中
serviceName: tomcat6
servicePort: 80
前面删了一个空格导致验证失败了,如下图对比:
修改前:
修改后:
更多推荐
所有评论(0)