How to configure k8s ingress with istio1.6

I followed the docs https://istio.io/docs/tasks/traffic-management/ingress/kubernetes-ingress/ , only the example which is in the docs can work. When i create a ingress configuration of my app, it can’t work.
here is my configuration:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: istio
    meta.helm.sh/release-name: identity-api
    meta.helm.sh/release-namespace: identity
  creationTimestamp: null
  generation: 1
  labels:
    app.kubernetes.io/instance: identity-api
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: identity-api
    app.kubernetes.io/version: 1.16.0
    helm.sh/chart: identity-api-0.1.0
  name: identity-api-public
  selfLink: /apis/extensions/v1beta1/namespaces/identity/ingresses/identity-api-public
spec:
  rules:
  - host: identity-api-staging.unity.cn
    http:
      paths:
      - backend:
          serviceName: identity-api-http-api
          servicePort: http-api
        path: /
  tls:
  - hosts:
    - identity-api-staging.unity.cn
    secretName: unity-cn-tls
status:
  loadBalancer: {}

Every time I visit url, I return 404.

below is the log of ingressgateway:

2020-06-07T23:15:06.655159552+08:00 stdout F {"protocol":"HTTP/2","upstream_service_time":"-","upstream_local_address":"-","duration":"0","upstream_transport_failure_reason":"-","route_name":"default","downstream_local_address":"172.20.0.108:8443","user_agent":"curl/7.64.1","response_code":"404","response_flags":"-","start_time":"2020-06-07T15:15:00.804Z","method":"GET","request_id":"bd59a027-2763-9d7c-8c92-e5e80021bf21","upstream_host":"-","x_forwarded_for":"58.33.9.194","requested_server_name":"identity-api-staging.unity.cn","bytes_received":"0","istio_policy_status":"-","bytes_sent":"0","upstream_cluster":"-","downstream_remote_address":"58.33.9.194:32068","authority":"identity-api-staging.unity.cn","path":"/system/healthz"}

when i use this command to look the route.
istioctl proxy-config routes istio-ingressgateway-7df7c4f8bf-6zc7w -n istio-system -o json

[
    {
        "name": "https.443.https-443-ingress-identity-api-public-identity-0.identity-api-public-istio-autogenerated-k8s-ingress.istio-system",
        "virtualHosts": [
            {
                "name": "blackhole:443",
                "domains": [
                    "*"
                ],
                "routes": [
                    {
                        "name": "default",
                        "match": {
                            "prefix": "/"
                        },
                        "directResponse": {
                            "status": 404
                        }
                    }
                ]
            }
        ],
        "validateClusters": false
    },
    {
        "name": "http.80",
        "virtualHosts": [
            {
                "name": "httpbin.example.com:80",
                "domains": [
                    "httpbin.example.com",
                    "httpbin.example.com:*"
                ],
                "routes": [
                    {
                        "match": {
                            "prefix": "/status",
                            "caseSensitive": true
                        },
                        "route": {
                            "cluster": "outbound|8000||httpbin.default.svc.cluster.local",
                            "timeout": "0s",
                            "retryPolicy": {
                                "retryOn": "connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes",
                                "numRetries": 2,
                                "retryHostPredicate": [
                                    {
                                        "name": "envoy.retry_host_predicates.previous_hosts"
                                    }
                                ],
                                "hostSelectionRetryMaxAttempts": "5",
                                "retriableStatusCodes": [
                                    503
                                ]
                            },
                            "maxGrpcTimeout": "0s"
                        },
                        "metadata": {
                            "filterMetadata": {
                                "istio": {
                                    "config": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtual-service/httpbin-example-com-ingress-istio-autogenerated-k8s-ingress"
                                }
                            }
                        },
                        "decorator": {
                            "operation": "httpbin.default.svc.cluster.local:8000/status*"
                        }
                    }
                ]
            }
        ],
        "validateClusters": false
    },

what’s wrong with the configuration?

I am having the same issue, the httpbin.example.com works fine but I am trying to do a simple example with nginx and I am getting 404 error

 [root@maurisae-m1 web]# curl -I -HHost:online.example.com  http://100.104.240.61:31380/eat
HTTP/1.1 404 Not Found
server: istio-envoy
date: Mon, 08 Jun 2020 22:16:28 GMT
content-type: text/html
content-length: 153
x-envoy-upstream-service-time: 1




[root@maurisae-m1 web]# curl 10.104.1.32:8080
Welcome Food
[root@maurisae-m1 web]# curl 10.97.44.107:8080
Welcome Video
[root@maurisae-m1 web]# 


[root@maurisae-m1 web]# kubectl get svc food-service -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2020-06-08T21:16:05Z"
  labels:
    app: webserver-food
    version: food
  name: food-service
  namespace: default
  resourceVersion: "8661771"
  selfLink: /api/v1/namespaces/default/services/food-service
  uid: 7df4be4d-e908-41c3-be0c-23384509f018
spec:
  clusterIP: 10.104.1.32
  ports:
  - port: 8080
    protocol: TCP
    targetPort: 80
  selector:
    app: webserver-food
    version: food


apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: istio
    ingress.kubernetes.io/rewrite-target: /
  name: ingress-video-food
spec:
  rules:
  - host: online.example.com
    http:
      paths:
      - backend:
          serviceName: food-service
          servicePort: 8080
        path: /eat
      - backend:
          serviceName: video-service
          servicePort: 8080
        path: /stream

Any idea what could be the issue?

The issue is related to : /rewrite-target: / . Any one knows how to setup this on Istio ?

Do you find out the reason?

It looks we must use istio gateway and VS for this…

I could not find any option for the rewrite on istio for the ingress resource with istio.

emm. I gave up, too.

@Jinjie_Li. Any update on setting up ingress with istio?

I just created the istio-autogenerated-k8s-ingress manually, and it seems to work.