Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use sub path url to access the gateway? #1750

Closed
4 of 5 tasks
TitanWhoo opened this issue Aug 27, 2022 · 2 comments
Closed
4 of 5 tasks

How can I use sub path url to access the gateway? #1750

TitanWhoo opened this issue Aug 27, 2022 · 2 comments

Comments

@TitanWhoo
Copy link

My actions before raising this issue

Why do you need this?

I have configured the ingress of openfaas, and I want to use sub path url to access the gateway

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    meta.helm.sh/release-name: openfaas
    meta.helm.sh/release-namespace: openfaas
  creationTimestamp: "2022-08-27T16:58:43Z"
  generation: 5
  labels:
    app: openfaas
    app.kubernetes.io/managed-by: Helm
    chart: openfaas-10.2.8
    heritage: Helm
    release: openfaas
  name: openfaas-ingress
  namespace: openfaas
  resourceVersion: "21798"
  uid: d2674b72-890e-4cc9-a9fa-89c1defe6a22
spec:                                       
  rules:                                   
  - host: example.com      
    http:                                  
      paths:                               
      - backend:                           
          service:                         
            name: gateway                  
            port:                          
              number: 8080                 
        path: /sub-path                     
        pathType: ImplementationSpecific   
status:                                    
  loadBalancer:                         
    ingress:                            
    - ip: xxx.xx.xxx.xx

Expected Behaviour

access the gateway by sub path url
like example/sub-path/ui/
or example.com/sub-path/function/hello-world

Current Behaviour

not working now

curl example.com/sub-path

404 page not found

Are you a GitHub Sponsor (Yes/No?)

Check at: https://github.com/sponsors/openfaas

  • Yes
  • No

Your Environment

  • FaaS-CLI version ( Full output from: faas-cli version ): 0.14.6
  • Docker version docker version (e.g. Docker 17.0.05 ): 20.10.14
  • Are you using OpenFaaS on Kubernetes or [faasd](https://github.com/openfaas/faasd)? Kubernetes
  • Operating System and version (e.g. Linux, Windows, MacOS): Ubuntu 20.04 LTS
@alexellis
Copy link
Member

Hi,

You've not actually answered this question

Why do you need this?

Instead you just wrote the technical solution you want without any context about why this is something you feel needs to be different to the openfaas design.

Answer this well, and we may be able to help you.

Alex

@TitanWhoo
Copy link
Author

I hope to have a global Nginx gateway to distribute my HTTP requests to different OpenFaas clusters, but also hope that their domain name is same.
For example, request to example.com/server-group-a will be distributed to the OpenFaas cluster of group-a, while request to example.com/server-group-b are distributed to the OpenFaas cluster of group-b.

@openfaas openfaas locked and limited conversation to collaborators Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants