Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes docker桌面上的istio ingress 404_Kubernetes_Kubernetes Ingress_Istio_Envoyproxy_Docker Desktop - Fatal编程技术网

Kubernetes docker桌面上的istio ingress 404

Kubernetes docker桌面上的istio ingress 404,kubernetes,kubernetes-ingress,istio,envoyproxy,docker-desktop,Kubernetes,Kubernetes Ingress,Istio,Envoyproxy,Docker Desktop,我一直在尝试使用Docker desktop在kubernetes和macOS上运行本地集群。我使用了bookinfo示例,一切正常 我有一个自己的服务,我无法让它运行。我试着用邮递员打它,总是得到一个404 我无法调试它,我可能只是错过了一些东西或做了一些愚蠢的事情。 这些是我的yaml文件 gateway.yaml 服务中心 我已经通过使用Nodeport公开服务来测试该服务,并且我可以卷曲并获得相应的响应,但是我犯了一些错误,无法正确配置入口 网址 我正在使用下面的URL。形成的url是l

我一直在尝试使用Docker desktop在kubernetes和macOS上运行本地集群。我使用了bookinfo示例,一切正常

我有一个自己的服务,我无法让它运行。我试着用邮递员打它,总是得到一个404

我无法调试它,我可能只是错过了一些东西或做了一些愚蠢的事情。 这些是我的yaml文件

gateway.yaml

服务中心

我已经通过使用Nodeport公开服务来测试该服务,并且我可以卷曲并获得相应的响应,但是我犯了一些错误,无法正确配置入口

网址

我正在使用下面的URL。形成的url是localhost/feed

错误


这里确实需要帮助。

如果您遇到404错误,这意味着您的应用程序已被访问,但没有/feed页面

您可以更改应用程序以提供该contextPath上的所有内容,也可以在VirtualService上进行重写:

http:
  - match:
    - uri:
        exact: /feed
    rewrite:
      uri: /
    route:
    - destination:
        host: feed
        port:
          number: 8080

如果您得到404错误,这意味着您的应用程序已被访问,但没有/feed页面

您可以更改应用程序以提供该contextPath上的所有内容,也可以在VirtualService上进行重写:

http:
  - match:
    - uri:
        exact: /feed
    rewrite:
      uri: /
    route:
    - destination:
        host: feed
        port:
          number: 8080
export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')


export INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')

echo $INGRESS_HOST
echo $INGRESS_PORT
echo $SECURE_INGRESS_PORT
[2020-08-22T01:01:05.088Z] "GET /feed HTTP/1.1" 404 - "-" "-" 0 19 29 22 "192.168.65.3" "PostmanRuntime/7.26.3" "e5705c53-6e70-9dbe-b831-764f9c7be63e" "localhost" "10.1.0.41:8080" outbound|8080||feed.default.svc.cluster.local 10.1.0.25:40654 10.1.0.25:8080 192.168.65.3:59050 - -
http:
  - match:
    - uri:
        exact: /feed
    rewrite:
      uri: /
    route:
    - destination:
        host: feed
        port:
          number: 8080