You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "debuggedme (via GitHub)" <gi...@apache.org> on 2025/03/30 02:24:43 UTC

[I] request help: cross-namespace usage in ApisixCRDs [apisix-ingress-controller]

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

   ### Issue description
   
   So far, I can only write a backends + (upstream in plugins), which feels stylistically fragmented but does work!
   
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: httpbin-apisixroute
   spec:
     http:
       - name: httpbin-apisixroute
         match:
           hosts:
             - httpbin.local
           paths:
             - /*
         backends:
           - serviceName: httpbin-svc
             servicePort: 80
         plugins:
           - name: traffic-split
             enable: true
             config:
               rules:
                 - match:
                     - vars:
                         - ["arg_ver", "==", "h11"]
                   weighted_upstreams:
                     - upstream:
                         name: h1
                         type: roundrobin
                         nodes:
                           httpbin-h1-svc.ingress-apisix:80: 1
   ```
   
   In [this link](https://github.com/apache/apisix-ingress-controller/blob/v1.8.4/pkg/kube/apisix/apis/config/v2/types.go#L73), the ApisixUpstreamCRD reference is used. I'm wondering why ApisixUpstream cannot be directly defined anonymously. Based on the [concepts](https://apisix.apache.org/docs/ingress-controller/concepts/apisix_upstream/#load-balancing), I tried defining an upstream with the same name as the service, but it didn’t take effect. It seems to require at least ExternalNodes or Discovery. Why can't a node be directly defined here?
   
   Looking at the source code, I found that backends are also parsed through traffic-split. While they are unified at the underlying level, their definitions are fragmented.
   
   Reference: [apisix_route.go#L187](https://github.com/apache/apisix-ingress-controller/blob/v1.8.4/pkg/providers/apisix/translation/apisix_route.go#L187)
   
   I would like to know: since backends currently do not support cross-namespace functionality, how can I achieve cross-namespace support?
   
   - If ApisixUpstreamCRD could directly define a node, would this issue still exist? Is my understanding correct?
   - [Cross-namespace references](https://apisix.apache.org/docs/ingress-controller/concepts/annotations/#cross-namespace-references): Why is cross-namespace referencing supported in IngressCRD, but not in ApisixRoute?
   - Is it necessary to define [https://apisix.apache.org/docs/ingress-controller/concepts/apisix_tls/]to enable HTTPS access? The tls field in Ingress does not seem to take effect, but after defining apisix_tls, it worked correctly.
   
   ### Environment
   
   - your apisix-ingress-controller version (output of apisix-ingress-controller version --long): 1.8.0
   - your Kubernetes cluster version (output of kubectl version): 1.31.x
   - if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a): amd64-linux 
   


-- 
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@apisix.apache.org.apache.org

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


Re: [I] request help: cross-namespace usage in ApisixCRDs [apisix-ingress-controller]

Posted by "debuggedme (via GitHub)" <gi...@apache.org>.
debuggedme closed issue #2376: request help: cross-namespace usage in ApisixCRDs
URL: https://github.com/apache/apisix-ingress-controller/issues/2376


-- 
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@apisix.apache.org

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