Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Ingress cannot configure multiple paths of same backend #215

Closed
addozhang opened this issue Jan 29, 2023 · 1 comment · Fixed by #217
Closed

Ingress cannot configure multiple paths of same backend #215

addozhang opened this issue Jan 29, 2023 · 1 comment · Fixed by #217
Assignees
Labels
area/ingress Task/Issue related to Ingress kind/bug Something isn't working
Milestone

Comments

@addozhang
Copy link

Bug description:

Affected area (please mark with X where applicable):

  • Install [ ]
  • Gateway API - GatewayClass [ ]
  • Gateway API - Gateway [ ]
  • Gateway API - HTTPRoute [ ]
  • Gateway API - TLSRoute [ ]
  • Gateway API - TCPRoute [ ]
  • Gateway API - UDPRoute [ ]
  • Gateway API - PolicyReference [ ]
  • Ingress [x]
  • Egress [ ]
  • MultiCluster [ ]
  • PIPY Control Plane [ ]
  • PIPY Script/Config [ ]
  • CLI Tool [ ]
  • Metrics [ ]
  • Certificate Management [ ]
  • Sidecar Injection [ ]
  • Logging [ ]
  • Debugging [ ]
  • Tests [ ]
  • Demo [ ]
  • CI System [ ]

Expected behavior:

It can route requests to different paths of same backend svc configured in Ingress.

Steps to reproduce the bug (as precisely as possible):

  1. Deploy httpbin deployment and service.
apiVersion: v1
kind: ServiceAccount
metadata:
  name: httpbin
---
apiVersion: v1
kind: Service
metadata:
  name: httpbin
  labels:
    app: httpbin
    service: httpbin
spec:
  ports:
  - name: http
    port: 14001
  selector:
    app: httpbin
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpbin
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpbin
  template:
    metadata:
      labels:
        app: httpbin
    spec:
      serviceAccountName: httpbin
      nodeSelector:
        kubernetes.io/arch: amd64
        kubernetes.io/os: linux
      containers:
      - image: kennethreitz/httpbin
        imagePullPolicy: IfNotPresent
        name: httpbin
        command: ["gunicorn", "-b", "0.0.0.0:14001", "httpbin:app", "-k", "gevent"]
        ports:
        - containerPort: 14001
  1. Apply Ingress
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: httpbin
spec:
  ingressClassName: pipy
  rules:
  - host: httpbin.org
    http:
      paths:
        - path: /headers
          pathType: Prefix
          backend:
            service:
              name: httpbin
              port:
                number: 14001
        - path: /get
          pathType: Prefix
          backend:
            service:
              name: httpbin
              port:
                number: 14001
  1. try to access /headers and /get, but can not reach /get
  2. check route config but path /get not there
{
   "trustedCAs": [],
   "certificates": {},
   "routes": {
      "/mesh/*": {
         "service": "fsm/fsm-repo-service:repo",
         "rewrite": [
            "^/mesh/?",
            "/"
         ]
      },
      "httpbin.org/headers/*": {
         "service": "httpbin/httpbin:http"
      }
   },
   "services": {
      "fsm/fsm-repo-service:repo": {
         "balancer": "round-robin",
         "upstream": {
            "endpoints": [
               {
                  "ip": "10.42.0.8",
                  "port": 6060
               }
            ]
         }
      },
      "httpbin/httpbin:http": {
         "balancer": "round-robin",
         "upstream": {
            "endpoints": [
               {
                  "ip": "10.42.0.9",
                  "port": 14001
               }
            ]
         }
      }
   }
}

How was FSM installed?:

helm

Anything else we need to know?:

Bug report archive:

Environment:

  • FSM version (use fsm version): 0.2.0
  • Kubernetes version (use kubectl version): 1.23
  • Size of cluster (number of worker nodes in the cluster): one node
  • Others:
@addozhang addozhang added the kind/bug Something isn't working label Jan 29, 2023
@addozhang addozhang changed the title Ingress not support multiple paths of same backend Ingress cannot configure multiple paths of same backend Jan 29, 2023
@reaver-flomesh reaver-flomesh added the area/ingress Task/Issue related to Ingress label Jan 29, 2023
@reaver-flomesh reaver-flomesh added this to the v0.2.1 milestone Jan 29, 2023
@reaver-flomesh reaver-flomesh self-assigned this Jan 29, 2023
@reaver-flomesh
Copy link
Collaborator

Thanks, it's confirmed to be an issue. Fixed now, please test against v0.2.1-alpha.1 and let us know if there's any problem.

image

image

@reaver-flomesh reaver-flomesh linked a pull request Jan 29, 2023 that will close this issue
@reaver-flomesh reaver-flomesh modified the milestones: v0.2.1, v0.2.2 Feb 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/ingress Task/Issue related to Ingress kind/bug Something isn't working
Projects
None yet
2 participants