Welcome to the Linux Foundation Forum!

Hi, Could you help me with the following error?

mesh@mesh:~$ kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: emojivoto
name: ingress-emojivoto
annotations:
ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/service-upstream: "true"
kubernetes.io/ingress.class: istio
consul.hashicorp.com/connect-inject: “true”
spec:
# ingressClassName: nginx

rules:
- http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: web-svc
port:
number: 80
EOF
error: error validating "STDIN": error validating data: [ValidationError(Ingress): unknown field "annotations" in io.k8s.api.networking.v1.Ingress, ValidationError(Ingress): unknown field "name" in io.k8s.api.networking.v1.Ingress, ValidationError(Ingress): unknown field "path" in io.k8s.api.networking.v1.Ingress, ValidationError(Ingress): unknown field "paths" in io.k8s.api.networking.v1.Ingress, ValidationError(Ingress): unknown field "port" in io.k8s.api.networking.v1.Ingress, ValidationError(Ingress): unknown field "rules" in io.k8s.api.networking.v1.Ingress, ValidationError(Ingress): unknown field "service" in io.k8s.api.networking.v1.Ingress]; if you choose to ignore these errors, turn validation off with --validate=false
mesh@mesh:~$

Answers

  • eporart
    eporart Posts: 26

    sorry I was not providing adequate space on the file

    mesh@mesh:~$ kubectl apply -f - <<EOF

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
    namespace: emojivoto
    name: ingress-emojivoto
    annotations:
    ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/service-upstream: "true"
    kubernetes.io/ingress.class: istio
    consul.hashicorp.com/connect-inject: i
    spec:
    # ingressClassName: nginx
    rules:
    - http:
    paths:
    - pathType: Prefix
    path: "/"
    backend:
    service:
    name: web-svc
    port:
    number: 80
    EOF

    thanks eporat

Categories

Upcoming Training