Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.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服务的快速网关配置_Kubernetes_Api Gateway_Express Gateway - Fatal编程技术网

Kubernetes服务的快速网关配置

Kubernetes服务的快速网关配置,kubernetes,api-gateway,express-gateway,Kubernetes,Api Gateway,Express Gateway,我正在尝试为我的微服务研究配置api网关。 我为这个pod创建了一个pod作为auth depl和auth src服务。 我还有另一个pod&服务,如links depl和links serv。 我想为您创建一个api网关。这些服务 “kubeectl get pods”的输出: NAME READY STATUS RESTARTS AGE api-gateway-depl-88b4c8b77-zdgjw 1/1

我正在尝试为我的微服务研究配置api网关。 我为这个pod创建了一个pod作为auth depl和auth src服务。 我还有另一个pod&服务,如links depl和links serv。 我想为您创建一个api网关。这些服务

kubeectl get pods”的输出:

NAME                                READY   STATUS    RESTARTS   AGE
api-gateway-depl-88b4c8b77-zdgjw    1/1     Running   0          10m
auth-depl-7cb78c4dcf-wxrwd          1/1     Running   0          10m
links-depl-69d749955d-5xf9b         1/1     Running   0          6m3s
NAME              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
api-gateway-srv   NodePort    10.98.213.62     <none>        8080:30623/TCP   12m
auth-srv          ClusterIP   10.98.214.62     <none>        3000/TCP         12m
kubernetes        ClusterIP   10.96.0.1        <none>        443/TCP          25h
links-srv         ClusterIP   10.99.37.46      <none>        3001/TCP         12m
“kubectl获取服务”的输出:

我只是尝试使用api网关访问身份验证服务,但我无法做到这一点。为此,我发送以下请求:

POST http://localhost:30623/user/signup
我得到“无法发布/用户/注册错误”

但是当我向
GEThttp://localhost:30624/ip
我可以收到回复


如何配置此gateway.config.yaml文件以解决我的问题。

在Express gateway中,您需要为每个ApiEndpoints定义一个管道。您有一个将(面向外部的)“api”端点映射到服务端点“httpbin”的管道,但缺少一个将“用户”端点映射到注册端点的管道

您需要将此管道添加到“管道”部分:


在Express Gateway中,您需要为每个APIendpoint定义一个管道。您有一个将(面向外部的)“api”端点映射到服务端点“httpbin”的管道,但缺少一个将“用户”端点映射到注册端点的管道

您需要将此管道添加到“管道”部分:


您没有用户ApiEndpoint的管道。您没有用户ApiEndpoint的管道。
POST http://localhost:30623/user/signup
pipelines:
  # Existing "default" pipeline
 user:
    apiEndpoints:
      - user
    policies:
      - proxy:
          - action:
              serviceEndpoint: usersrv 
              changeOrigin: true