boscard opened a new issue, #2276:
URL: https://github.com/apache/apisix-ingress-controller/issues/2276

   ### Current Behavior
   
   Defining two ingress definitions pointing to single service with pathType 
prefix and different paths will cause 
   ```
   error   adapter/etcd.go:141     failed to create object, ignore it{error 26 
0  rpc error: code = InvalidArgument desc = etcdserver: duplicate key given in 
txn request} {revision 11 2939  <nil>} {key 15 0 /apisix/upstreams/5ce57b8e 
<nil>}
   ```
   Where in traditional mode everything works perfectly fine.
   
   ### Expected Behavior
   
   In combine mode there should also be possible to define multiple ingress 
definitions pointing to single service, where path is different for ingress 
definitions. 
   
   ### Error Logs
   
   ```
   2024-08-05T22:18:01+08:00       info    adapter/etcd.go:147     created 
object{revision 11 2938  <nil>} {key 15 0 /apisix/upstreams/5ce57b8e <nil>}
   2024-08-05T22:18:01+08:00       info    adapter/etcd.go:147     created 
object{revision 11 2939  <nil>} {key 15 0 /apisix/routes/bcb4f1ad <nil>}
   2024-08-05T22:18:01+08:00       error   adapter/etcd.go:141     failed to 
create object, ignore it{error 26 0  rpc error: code = InvalidArgument desc = 
etcdserver: duplicate key given in txn request} {revision 11 2939  <nil>} {key 
15 0 /apisix/upstreams/5ce57b8e <nil>}
   2024-08-05T22:18:01+08:00       info    adapter/etcd.go:147     created 
object{revision 11 2940  <nil>} {key 15 0 /apisix/routes/59ac5ae4 <nil>}
   ```
   
   ### Steps to Reproduce
   
   1. Install APISIX Ingress controller in combined mode
   2. Deploy httpbin for example using this specs:
   ```
   ---
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: httpbin-deployment
     namespace: default
   spec:
     replicas: 1
     selector:
       matchLabels:
         app: httpbin-deployment
     template:
       metadata:
         labels:
           app: httpbin-deployment
       spec:
         containers:
           - name: httpbin-deployment
             image: kennethreitz/httpbin:latest
             imagePullPolicy: IfNotPresent
             ports:
               - name: http
                 containerPort: 80
                 protocol: TCP
             resources: {}
             livenessProbe:
               tcpSocket:
                 port: 80
               initialDelaySeconds: 2
               timeoutSeconds: 2
               periodSeconds: 5
               successThreshold: 1
               failureThreshold: 3
             readinessProbe:
               tcpSocket:
                 port: 80
               initialDelaySeconds: 2
               timeoutSeconds: 2
               periodSeconds: 5
               successThreshold: 1
               failureThreshold: 3
   ---
   apiVersion: v1
   kind: Service
   metadata:
     name: httpbin
     namespace: default
   spec:
     selector:
       app: httpbin-deployment
     ports:
     - name: http
       port: 80
       protocol: TCP
       targetPort: 80
     type: ClusterIP
   ```
   3. Deploy 2 Ingress definitions 
   ```
   ---
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     name: api1
     namespace: default
   spec:
     ingressClassName: apisix
     rules:
       - http:
           paths:
             - backend:
                 service:
                   name: httpbin
                   port:
                     number: 80
               path: /api1/api1
               pathType: Prefix
   ---
   apiVersion: networking.k8s.io/v1
   kind: Ingress
   metadata:
     name: api2
     namespace: default
   spec:
     ingressClassName: apisix
     rules:
       - http:
           paths:
             - backend:
                 service:
                   name: httpbin
                   port:
                     number: 80
               path: /api2/api2
               pathType: Prefix
   ```
   
   ### Environment
   
   - APISIX Ingress controller version: v1.7.0, v1.7.1, v1.8.0, v1.8.1, v1.8.2
   - Kubernetes cluster version: v1.29.2
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to