You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "riverwoo (via GitHub)" <gi...@apache.org> on 2023/09/28 02:55:41 UTC

[GitHub] [shenyu] riverwoo opened a new issue, #5191: [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway?

riverwoo opened a new issue, #5191:
URL: https://github.com/apache/shenyu/issues/5191

   ### Question
   
   All frontend and backend projects are deployed in kubernetes. How does the frontend project access the backend service through the shenyu gateway? The frontend project accesses through the ingress, but the ingress is forwarded to the kubernetes service, thus skipping the shenyu gateway. If the frontend project is deployed outside the kubernetes cluster , the frontend project can directly set the proxy to the ingress address of the shenyu gateway.
   ```
   [root@k8s-master ~]# kubectl get ing -A
   NAMESPACE    NAME                     CLASS     HOSTS                                         ADDRESS                                            PORTS     AGE
   prod               frontend-ing             nginx      frontend.shalala.com                   172.17.30.1,172.17.30.2,172.17.30.3    80          16h
   shenyu           shenyu-admin           nginx      prod.shenyu.shalala.com             172.17.30.1,172.17.30.2,172.17.30.3    80          34d
   shenyu           shenyu-bootstrap      nginx     prod.shenyu-gw.shalala.com       172.17.30.1,172.17.30.2,172.17.30.3    80          34d
   ```
   ```
   [root@k8s-master ~]# kubectl get ing -n frontend-ing -oyaml
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     creationTimestamp: "2023-09-27T09:44:47Z"
     generation: 6
     name: frontend-ing
     namespace: prod
     resourceVersion: "7975915"
     uid: c215764b-7630-485f-9b74-a83cea97539e
   spec:
     ingressClassName: nginx
     rules:
     - host: frontend.shalala.com
       http:
         paths:
         - backend:
             service:
               name: admin-frontend
               port:
                 number: 80
           path: /
           pathType: Prefix
         - backend:
             service:
               name: admin-backend
               port:
                 number: 80
           path: /v1
           pathType: Prefix
   status:
     loadBalancer:
       ingress:
       - ip: 172.17.30.1
       - ip: 172.17.30.2
       - ip: 172.17.30.3
   ```
   ```
   [root@k8s-master ~]# kubectl get svc -A
   NAMESPACE        NAME                           TYPE             CLUSTER-IP          EXTERNAL-IP      PORT(S)                     AGE
   prod                    admin-frontend             ClusterIP       10.233.1.35          <none>              80/TCP                      16h
   prod                    admin-backend              ClusterIP       10.233.48.209      <none>             80/TCP                      16h
   shenyu                shenyu-admin-svc         NodePort      10.233.36.102      <none>              9095:31095/TCP       34d
   shenyu                shenyu-bootstrap-svc    NodePort      10.233.43.162      <none>             9195:31195/TCP        34d
   ```
   ```
   [root@k8s-master ~]# kubectl get cm -n prod admin-frontend-cm -oyaml
   apiVersion: v1
   kind: ConfigMap
   metadata:
     name: admin-frontend-cm
     namespace: prod
   data:
     a.conf: |-
       server {
         listen       80;
         server_name  frontend.shalala.com;
   
         location / {
           root   /usr/share/nginx/html;
           index  index.html;
           try_files $uri $uri/ @router;
         }
   
         location /v1 {
           proxy_pass http://prod.shenyu-gw.shalala.com/admin-backend;
         }
   
         location @router {
           rewrite ^.*$ /index.html last;
         }
       }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway? [shenyu]

Posted by "riverwoo (via GitHub)" <gi...@apache.org>.
riverwoo commented on issue #5191:
URL: https://github.com/apache/shenyu/issues/5191#issuecomment-1751613680

   @moremind I don't quite understand what you mean


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway? [shenyu]

Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind commented on issue #5191:
URL: https://github.com/apache/shenyu/issues/5191#issuecomment-1756662898

   you should modify shenyu-dashboard(frontend) forward address to shenyu-admin backend


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway? [shenyu]

Posted by "riverwoo (via GitHub)" <gi...@apache.org>.
riverwoo closed issue #5191: [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway?
URL: https://github.com/apache/shenyu/issues/5191


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway? [shenyu]

Posted by "riverwoo (via GitHub)" <gi...@apache.org>.
riverwoo commented on issue #5191:
URL: https://github.com/apache/shenyu/issues/5191#issuecomment-1756653903

   @moremind Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway? [shenyu]

Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind commented on issue #5191:
URL: https://github.com/apache/shenyu/issues/5191#issuecomment-1756615384

   > @moremind I don't quite understand what you mean
   
   Do you want to deploy frontend at another pod?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Question] In kubernetes, how does the frontend project access the backend service through the shenyu gateway? [shenyu]

Posted by "moremind (via GitHub)" <gi...@apache.org>.
moremind commented on issue #5191:
URL: https://github.com/apache/shenyu/issues/5191#issuecomment-1751543799

   admin has included frontend and backend


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org