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

   ### Issue description
   
   I have created a service and upstream for httpbin deployment as mentioned in 
[ApisixUpstream](https://apisix.apache.org/docs/ingress-controller/concepts/apisix_upstream/#load-balancing).
   
   I can see that service and ApisixUpstream is created in K8s. But upstream is 
not being listed when queried from APISIX.
   
   My service and ApisixUpstream yaml is as follows : 
   
   ```
   apiVersion: v1
   kind: Service
   metadata:
     name: httpbin-service
     namespace: ingress-apisix
   spec:
     selector:
       app: httpbin
     ports:
       - protocol: TCP
         port: 80
         targetPort: 80
    ---     
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: httpbin-service
     namespace: ingress-apisix
   spec:
     loadbalancer:
       type: ewma
   ```
   
   Service and ApisixUpstream info shown from K8s. 
   ```
   
   % kubectl get svc -n ingress-apisix httpbin-service
   NAME              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
   httpbin-service   ClusterIP   10.109.172.218   <none>        80/TCP    2m57s
   
   % kubectl describe au -n ingress-apisix httpbin-service
   Name:         httpbin-service
   Namespace:    ingress-apisix
   Labels:       <none>
   Annotations:  <none>
   API Version:  apisix.apache.org/v2
   Kind:         ApisixUpstream
   Metadata:
     Creation Timestamp:  2023-11-07T11:28:41Z
     Generation:          1
     Resource Version:    208950
     UID:                 a8b24a54-48b7-443a-8085-ffa6fc362436
   Spec:
     Loadbalancer:
       Type:  ewma
   Status:
     Conditions:
       Message:              Sync Successfully
       Observed Generation:  1
       Reason:               ResourcesSynced
       Status:               True
       Type:                 ResourcesAvailable
   Events:
     Type    Reason           Age                From           Message
     ----    ------           ----               ----           -------
     Normal  ResourcesSynced  64s (x2 over 64s)  ApisixIngress  ApisixIngress 
synced successfully
   
   ```
   
   Querying upstreams from APISIX pod **does not return the upstream object 
created above** : 
   ```
   Apisix-POD$ curl -X GET "http://127.0.0.1:9180/apisix/admin/upstreams"; -H 
"X-API-KEY: edd1c9f034335f136f87ad84b625c8f1"
   {"total":0,"list":[]}
   ```
   
   Logs of apisix-ingress-controller : 
   
   ```
   2023-11-07T20:20:12+08:00       warn    apisix/upstream.go:69   upstream not 
found      {"name": "ingress-apisix_httpbin-service_80", "url": 
"http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/d035462";,
 "cluster": "default"}
   2023-11-07T20:20:12+08:00       warn    types/types.go:212      upstream is 
not referenced      {"cluster": "name=default; 
base_url=http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin";,
 "upstream": "ingress-apisix_httpbin-service_80"}
   2023-11-07T20:20:12+08:00       warn    apisix/upstream.go:69   upstream not 
found      {"name": "ingress-apisix_httpbin-service_80", "url": 
"http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/d035462";,
 "cluster": "default"}
   2023-11-07T20:20:12+08:00       warn    apisix/upstream.go:69   upstream not 
found      {"name": "ingress-apisix_httpbin-service_80_service", "url": 
"http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/ae85a7d2";,
 "cluster": "default"}
   W1107 20:20:12.947333       1 warnings.go:70] unknown field 
"status.conditions[0].lastTransitionTime"
   2023-11-07T20:20:12+08:00       warn    apisix/upstream.go:69   upstream not 
found      {"name": "ingress-apisix_httpbin-service_80", "url": 
"http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/d035462";,
 "cluster": "default"}
   2023-11-07T20:20:12+08:00       warn    apisix/upstream.go:69   upstream not 
found      {"name": "ingress-apisix_httpbin-service_80_service", "url": 
"http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/ae85a7d2";,
 "cluster": "default"}
   W1107 20:20:12.955643       1 warnings.go:70] unknown field 
"status.conditions[0].lastTransitionTime"
   
   2023-11-07T20:20:20+08:00       info    [email protected]/context.go:173       
path: /healthz, status: 200, method: GET, query: , ip: 10.244.0.1, user-agent: 
kube-probe/1.26, errors: , cost: 172.25µs
   2023-11-07T20:20:20+08:00       info    [email protected]/context.go:173       
path: /healthz, status: 200, method: GET, query: , ip: 10.244.0.1, user-agent: 
kube-probe/1.26, errors: , cost: 36.625µs
   2023-11-07T20:20:21+08:00       warn    apisix/upstream.go:69   upstream not 
found      {"name": "ingress-apisix_httpbin-service_80", "url": 
"http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin/upstreams/d035462";,
 "cluster": "default"}
   2023-11-07T20:20:21+08:00       warn    types/types.go:212      upstream is 
not referenced      {"cluster": "name=default; 
base_url=http://apisix-admin.ingress-apisix.svc.cluster.local:9180/apisix/admin";,
 "upstream": "ingress-apisix_httpbin-service_80"}
   ```
   
   ### Environment
   
   - your apisix-ingress-controller version (output of 
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
   ```
   - your Kubernetes cluster version (output of kubectl version): 
   `Client Version: v1.27.1
   `
   - if you run apisix-ingress-controller in Bare-metal environment, also show 
your OS version (uname -a): NA
   


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