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/19 01:36:57 UTC

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

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

   ### 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-ingress-controller] jiangfucheng commented on issue #1801: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

Posted by "jiangfucheng (via GitHub)" <gi...@apache.org>.
jiangfucheng commented on issue #1801:
URL: https://github.com/apache/apisix-ingress-controller/issues/1801#issuecomment-1518684598

   Hi, @unreal-altran , this bug seems to have been fixed in the latest version. I reproduced this bug in version 1.6.0, but when I try to use lastest version of apisix-ingress-controller, it works well.


-- 
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-ingress-controller] unreal-altran commented on issue #1801: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

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

   Hi, @jiangfucheng yes I can confirm that with the 1.6.1 version of the ingress controller the problem does not occur.
   I noticed during my last test that currently the [Apisix helm charts](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/Chart.yaml)  has a dependency to an older version of the ingress controller. I think it should be changed to 0.11.6 that has the ingress appVersion: 1.6.1 :-)


-- 
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-ingress-controller] tao12345666333 closed issue #1801: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly

Posted by "tao12345666333 (via GitHub)" <gi...@apache.org>.
tao12345666333 closed issue #1801: bug: CRD ApisixRoute with an ApisixPluginConfig & ApisixUpstream not configured correctly
URL: https://github.com/apache/apisix-ingress-controller/issues/1801


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