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

   ### Current Behavior
   
   Ingress controller use default namespace instead of namespace declared in 
ApisixRoute object.
   
   ### Expected Behavior
   
   Ingress controller should use same namespace as ApisixRoute has.
   
   ### Error Logs
   
   See below 
   
   ### Steps to Reproduce
   
   Route:
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: argocd-server
   spec:
     http:
       - name: http
         match:
           hosts:
             - cd.someurl.duckdns.org
           paths:
             - /*
         backends:
           - serviceName: argocd-server
             servicePort: 80
   
   ```
   
   Logs of the controller pod:
   ```json
   2023-08-28T23:39:27+08:00       error   translation/translator.go:158   
failed to translate ingress backend to upstream {"error": "endpoints: endpoints 
\"argocd-server\" not found", "ingress": "&Ingress{ObjectMeta:{argocd-server  
default  ba1f23be-4d9f-4a23-85e6-590e248e7fac 6200 1 2023-08-28 07:51:06 +0800 
HKT <nil> <nil> map[] 
map[kubectl.kubernetes.io/last-applied-configuration:{\"apiVersion\":\"networking.k8s.io/v1\",\"kind\":\"Ingress\",\"metadata\":{\"annotations\":{},\"name\":\"argocd-server\",\"namespace\":\"default\"},\"spec\":{\"ingressClassName\":\"apisix\",\"rules\":[{\"host\":\"cd.someurl.duckdns.org\",\"http\":{\"paths\":[{\"backend\":{\"service\":{\"name\":\"argocd-server\",\"port\":{\"number\":80}}},\"path\":\"/\",\"pathType\":\"Prefix\"}]}}]}}\n]
 [] [] [{kubectl-client-side-apply Update networking.k8s.io/v1 2023-08-28 
07:51:06 +0800 HKT FieldsV1 
{\"f:metadata\":{\"f:annotations\":{\".\":{},\"f:kubectl.kubernetes.io/last-applied-configuration\":{}}},\"f:spec\":{\"f
 :ingressClassName\":{},\"f:rules\":{}}} 
}]},Spec:IngressSpec{DefaultBackend:nil,TLS:[]IngressTLS{},Rules:[]IngressRule{IngressRule{Host:cd.someurl.duckdns.org,IngressRuleValue:IngressRuleValue{HTTP:&HTTPIngressRuleValue{Paths:[]HTTPIngressPath{HTTPIngressPath{Path:/,Backend:IngressBackend{Resource:nil,Service:&IngressServiceBackend{Name:argocd-server,Port:ServiceBackendPort{Name:,Number:80,},},},PathType:*Prefix,},},},},},},IngressClassName:*apisix,},Status:IngressStatus{LoadBalancer:{[]},},}"}
   2023-08-28T23:39:27+08:00       error   ingress/ingress.go:148  failed to 
translate ingress     {"error": "endpoints: endpoints \"argocd-server\" not 
found", "ingress": {}}
   ```
   
   Service exists in the argocd namespace
   ```
   ❯ k get -n argocd services argocd-server 
   NAME            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          
AGE
   argocd-server   ClusterIP   10.102.103.109   <none>        80/TCP,443/TCP   
15h
   ```
   
   but doesn't exist in the default namespace which targets controller:
   ```
   ❯ k get -n default services argocd-server
   Error from server (NotFound): services "argocd-server" not found
   ``` 
   
   
   ### Environment
   
   ```
   /ingress-apisix # ls
   apisix-ingress-controller  conf
   /ingress-apisix # ./apisix-ingress-controller version --long
   Version: 1.6.0
   Git SHA: no-git-module
   Go Version: go1.19.4
   Building OS/Arch: linux/aarch64
   Running OS/Arch: linux/arm64
   ```
   
   ```
   Client Version: v1.28.1
   Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
   Server Version: v1.27.4
   ```
   


-- 
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