You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "unreal-altran (via GitHub)" <gi...@apache.org> on 2023/04/18 11:00:44 UTC

[GitHub] [apisix] unreal-altran opened a new issue, #9331: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

unreal-altran opened a new issue, #9331:
URL: https://github.com/apache/apisix/issues/9331

   ### Current Behavior
   
   I followed this official apisix [tutorial](https://apisix.apache.org/docs/ingress-controller/tutorials/external-service-discovery/) but with Consul discovery type. Everything works correctly if configured via ApiSix API but the reference to the plugin is lost if configured via CRD ( apisix ingress controller).
   
   
   I have tried different configurations with CRD. The following doesn't work. plugin_config_id field is missing from the configuration applied by the CRDs (example --> "plugin_config_id": "246f7509")
   
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixPluginConfig
   metadata:
     name: json-server-plugins
   spec:
     plugins:
       - name: openid-connect
         enable: true
         config:
           client_id: "json-server"
           client_secret: "yyyy"
           discovery: "xxxx"
           scope: "openid profile roles address phone"
           bearer_only: true
           realm: "zzzz"
           redirect_uri: "/*"
           logout_path: "/logout"
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: json-server-upstream
   spec:
     discovery:
       type: consul
       serviceName: json-server
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: json-server-route
   spec:
     http:
       - name: json-server
         match:
           hosts:
             - json-server.apisix.apps.lab.com
           paths:
             - /*
         plugin_config_name: json-server-plugins
         upstreams:
           - name: json-server-upstream
   ```        
   
   But this configuration works very well (the same but with plugin definition embedded directly to the route)
   
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixUpstream
   metadata:
     name: json-server-upstream
   spec:
     discovery:
       type: consul
       serviceName: json-server
   ---
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: json-server-route
   spec:
     http:
       - name: json-server
         match:
           hosts:
             - json-server.apisix.apps.lab.com
           paths:
             - /*
         upstreams:
           - name: json-server-upstream
         plugins:
           - name: openid-connect
             enable: true
             config:
               client_id: "json-server"
               client_secret: "yyyy"
               discovery: "xxxx"
               scope: "openid profile roles address phone"
               bearer_only: true
               realm: "zzzz"
               redirect_uri: "/*"
               logout_path: "/logout"
   ``` 
   
   **I also tried the first example (which doesn't work) and then I manually changed the configuration by adding "plugin_config_id": "246f7509" and everything worked perfectly.**
   
   
   ### Expected Behavior
   
   A route with references to plugin and upstream as required by the CRD configurations
   Example:
   
   ``` json
   {
     "uris": [
       "/*"
     ],
     "name": "consul_json-server-route_json-server",
     "desc": "Created by apisix-ingress-controller, DO NOT modify it manually",
     "hosts": [
       "json-server.apisix.apps.lab.com"
     ],
     **"plugin_config_id": "246f7509",**
     **"upstream_id": "72c79c84",**
     "labels": {
       "managed-by": "apisix-ingress-controller"
     },
     "status": 1
   }
   ``` 
   
   But I get this result
   
   ``` json
   {
     "uris": [
       "/*"
     ],
     "name": "consul_json-server-route_json-server",
     "desc": "Created by apisix-ingress-controller, DO NOT modify it manually",
     "hosts": [
       "json-server.apisix.apps.lab.com"
     ],
     **"upstream_id": "72c79c84",**
     "labels": {
       "managed-by": "apisix-ingress-controller"
     },
     "status": 1
   }
   ``` 
   
   ### Error Logs
   
   Nothing relevant
   
   ### Steps to Reproduce
   
   Followed this official apisix [tutorial](https://apisix.apache.org/docs/ingress-controller/tutorials/external-service-discovery/) but with Consul discovery type.
   
   ### Environment
   
   - APISIX 3.2 & APISIX INGRESS 1.6.1
   - kubernetes
   


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


[GitHub] [apisix] tao12345666333 commented on issue #9331: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 commented on issue #9331:
URL: https://github.com/apache/apisix/issues/9331#issuecomment-1513057058

   sure


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


[GitHub] [apisix] shreemaan-abhishek commented on issue #9331: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #9331:
URL: https://github.com/apache/apisix/issues/9331#issuecomment-1513055312

   can we transfer this to the ingress-controller repository?
   
   cc: @tao12345666333


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


[GitHub] [apisix] unreal-altran commented on issue #9331: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

Posted by "unreal-altran (via GitHub)" <gi...@apache.org>.
unreal-altran commented on issue #9331:
URL: https://github.com/apache/apisix/issues/9331#issuecomment-1513505186

   @tao12345666333, Should I open a new bug on the ingress controller repository?


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