wjx8382 commented on issue #356:
URL: 
https://github.com/apache/apisix-ingress-controller/issues/356#issuecomment-818391921


   > > @tokers Why does `kubectl exec -it -n tools apisix-7987b5b7f-tmrk7 -- 
curl http://127.0.0.1:9080/headers -H 'Host: local.httpbin.org'` returns 
`{"error_msg":"404 Route Not Found"}`
   > > ```
   > > # httpbin-route.yaml
   > > apiVersion: apisix.apache.org/v2alpha1
   > > kind: ApisixRoute
   > > metadata:
   > >   name: httpserver-route
   > > spec:
   > >   http:
   > >   - name: rule1
   > >     match:
   > >       hosts:
   > >       - local.httpbin.org
   > >       paths:
   > >       - /*
   > >     backend:
   > >       serviceName: httpbin-85d57ddd75-wtmwh
   > >       servicePort: 80
   > > ```
   > 
   > Could you access the apisix admin API by
   > 
   > ```
   > kubectl exec -it -n tools apisix-7987b5b7f-tmrk7 -- curl 
http://127.0.0.1:9180/apisix/admin/routes
   > ```
   > 
   > To see the routes?
   
   `kubectl exec -it -n tools apisix-7987b5b7f-tmrk7 -- curl 
http://127.0.0.1:9180/apisix/admin/routes -H 'X-API-Key: 
edd1c9f034335f136f87ad84b625c8f1'` returns
   ```
   
{"node":{"key":"\/apisix\/routes","nodes":[{"value":{"update_time":1615967207,"uris":["\/hello"],"id":"1","status":1,"create_time":1615797004,"name":"hello","upstream_id":"346344795876098996","plugins":{"fault-injection":{"disable":true,"delay":{"duration":3}},"proxy-rewrite":{"disable":false,"scheme":"https","regex_uri":["^\/samplePrefix\/get(.*)","\/hello$1"]}},"vars":{}},"key":"\/apisix\/routes\/1","modifiedIndex":1902,"createdIndex":39},{"value":{"priority":0,"uri":"\/grpctest","methods":["GET"],"status":1,"create_time":1615878242,"update_time":1615878242,"upstream":{"pass_host":"pass","nodes":{"127.0.0.1:50051":1},"hash_on":"vars","type":"roundrobin"},"plugins":{"grpc-transcode":{"deadline":0,"service":"helloworld.Greeter","proto_id":"1","method":"SayHello"}},"id":"111"},"key":"\/apisix\/routes\/111","modifiedIndex":1350,"createdIndex":1350},{"value":{"update_time":1618212271,"uris":["\/httpbin"],"id":"350111307409654788","methods":["GET","HEAD","POST","PUT","DELETE","OPTIONS
 
","PATCH"],"status":1,"hosts":["local.httpbin.org"],"create_time":1618212201,"name":"httpbin","upstream_id":"350111087426798596","vars":{}},"key":"\/apisix\/routes\/350111307409654788","modifiedIndex":18185,"createdIndex":18182},{"value":{"update_time":1618210980,"uris":["\/get"],"id":"5","status":1,"create_time":1615789201,"name":"test","upstream_id":"50","plugins":{"http-logger":{"uri":"http:\/\/127.0.0.1:80\/postendpoint?param=1","disable":false},"limit-conn":{"rejected_code":503,"conn":1,"burst":0,"disable":true,"key":"remote_addr","default_conn_delay":0.1},"basic-auth":{"disable":true},"fault-injection":{"disable":true,"abort":{"http_status":403,"body":"Fault
 
Injection!\n","vars":[[["arg_name","==","jack"]]]}},"proxy-rewrite":{"scheme":"https","disable":false},"authz-keycloak":{"token_endpoint":"http:\/\/127.0.0.1:8090\/auth\/realms\/{client_id}\/protocol\/openid-connect\/token","disable":true,"audience":"Client
 ID","permissions":["resource name#scope name"]},"ip-restriction":{
 
"whitelist":["172.16.110.186","127.0.0.1"],"disable":false},"serverless-pre-function":{"phase":"rewrite","functions":["return
 function() ngx.log(ngx.ERR, \"serverless pre function\"); 
end"],"disable":false},"limit-count":{"rejected_code":503,"key":"remote_addr","count":2,"disable":true,"time_window":60},"batch-requests":{"disable":false},"cors":{"disable":false},"uri-blocker":{"block_rules":["get"],"disable":true},"key-auth":{"disable":true},"serverless-post-function":{"phase":"rewrite","functions":["return
 function() ngx.log(ngx.ERR, \"serverless post function\"); 
end"],"disable":false},"request-id":{"include_in_response":true,"disable":false},"prometheus":{"disable":false},"limit-req":{"rate":1,"key":"remote_addr","burst":2,"disable":true,"rejected_code":503},"request-validation":{"disable":true,"body_schema":{"required":["required_payload"],"type":"object","properties":{"required_payload":{"type":"string"},"boolean_payload":{"type":"boolean"}}}},"jwt-auth":{"disable":true}},"vars
 
":{}},"key":"\/apisix\/routes\/5","modifiedIndex":18159,"createdIndex":16}],"dir":true},"action":"get","count":"5"}
   ```


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

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


Reply via email to