dxq6888 opened a new issue, #12479:
URL: https://github.com/apache/apisix/issues/12479

   ### Description
   
   ```
   apisix:
     node_listen: 9080
     enable_ipv6: false
   
     enable_control: true
     control:
       ip: "0.0.0.0"
       port: 9092
   
   nginx_config:
     error_log_level: debug
   
   discovery:
     kubernetes:
     - id: prod1
       service:
         schema: https
         host: "a.example.com"
         port: "443"
       client:
         token: |-
           xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       default_weight: 50
       namespace_selector:
         match:
           - ".*"
       shared_size: 1m
       watch_endpoint_slices: false
     - id: prod2
       service:
         schema: https
         host: "b.example.com"
         port: "443"
       client:
         token: |-
           xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       default_weight: 50
       namespace_selector:
         match:
           - ".*"
       shared_size: 1m
       watch_endpoint_slices: false 
   
   deployment:
     admin:
       allow_admin:  
         - 0.0.0.0/0
   
       admin_key:
         - name: "admin"
           key: edd1c9f034335f136f87ad84b625c8f1
           role: admin
   
         - name: "viewer"
           key: 4054f7cf07e344346cd3f287985e76a2
           role: viewer
   
     etcd:
       host:
         - "http://etcd:2379";
       prefix: "/apisix"     
       timeout: 30
   
   plugin_attr:
     prometheus:
       export_addr:
         ip: "0.0.0.0"
         port: 9091
   ```
   
   The above is my apisix configuration file. I am doing automatic discovery 
for multiple k8s clusters, but following the above configuration will result in 
the following error
   ```
   docker logs -f 42aa972214e6
   /usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
   failed to read local yaml config of apisix: invalid discovery kubernetes 
configuration: object matches none of the required
   /usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
   failed to read local yaml config of apisix: invalid discovery kubernetes 
configuration: object matches none of the required
   /usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
   failed to read local yaml config of apisix: invalid discovery kubernetes 
configuration: object matches none of the required
   /usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
   failed to read local yaml config of apisix: invalid discovery kubernetes 
configuration: object matches none of the required
   ```
   
   If only one cluster is possible, as configured below
   ```
   apisix:
     node_listen: 9080              # APISIX listening port
     enable_ipv6: false
   
     enable_control: true
     control:
       ip: "0.0.0.0"
       port: 9092
   
   nginx_config:
     error_log_level: debug
   
   discovery:
     kubernetes:
     - id: prod1
       service:
         schema: https
         host: "a.example.com"
         port: "443"
       client:
         token: |-
           xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       default_weight: 50
       namespace_selector:
         match:
           - ".*"
       shared_size: 1m
       watch_endpoint_slices: false
   
   deployment:
     admin:
       allow_admin:  
         - 0.0.0.0/0
   
       admin_key:
         - name: "admin"
           key: edd1c9f034335f136f87ad84b625c8f1
           role: admin
   
         - name: "viewer"
           key: 4054f7cf07e344346cd3f287985e76a2
           role: viewer
   
     etcd:
       host:
         - "http://etcd:2379";
       prefix: "/apisix"     
       timeout: 30
   
   plugin_attr:
     prometheus:
       export_addr:
         ip: "0.0.0.0"
         port: 9091
   ```
   
   I would like to know if there is a problem with my configuration or if 
Apisix does not support automatic discovery of services in multiple Kubernetes 
clusters
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


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

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

Reply via email to