You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "yujinchoi-94 (via GitHub)" <gi...@apache.org> on 2023/03/23 02:56:28 UTC

[GitHub] [apisix-ingress-controller] yujinchoi-94 commented on issue #1693: bug: plugin_config_name is not working in ApisixRoute CRD

yujinchoi-94 commented on issue #1693:
URL: https://github.com/apache/apisix-ingress-controller/issues/1693#issuecomment-1480533031

   @tao12345666333 
   Same here.
   Here's what I've configured.
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: openapi-alimi-route
     namespace: ingress-apisix
   spec:
     http:
     - name: rule-***
       priority: 1
       match:
         hosts:
           {{- include "openapi.hosts" . | indent 8 }}
         paths:
           - *** 
       upstreams:
         - name: cv-upstream
       plugin_config_name: openapi-plugin-config
   ```
   ```yaml
   apiVersion: apisix.apache.org/v2
   kind: ApisixPluginConfig
   metadata:
     name: openapi-plugin-config
     namespace: ingress-apisix
   spec:
     plugins:
     - name: forward-auth
       enable: true
       config:
         request_method: GET
         uri: ***
         request_headers: ***
         upstream_headers: ***
     - name: prometheus
       enable: true
       config:
         disable: false
         prefer_name: true
     - name: http-logger
       enable: true
       config:
         uri: ***
     - name: proxy-rewrite
       enable: true
       config:
         uri: ***
         headers:
           ***
   ```
   
   When I call check a route using ADMIN API neither `plugin_config_name` nor `plugin_config_id` appears.
   ```json
   curl 10.192.145.209:9180/apisix/admin/routes/31ceeb97 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' | jq
   {
     "value": {
       "labels": {
         "managed-by": "apisix-ingress-controller"
       },
       "hosts": [
         ***
       ],
       "desc": "Created by apisix-ingress-controller, DO NOT modify it manually",
       "id": "31ceeb97",
       "update_time": 1679539025,
       "status": 1,
       "create_time": 1679536996,
       "uris": [
         ***
       ],
       "upstream_id": "281b5cf0",
       "name": "ingress-apisix_openapi-alimi-route_rule-alimi",
       "priority": 1
     },
     "modifiedIndex": 62324,
     "key": "/apisix/routes/31ceeb97",
     "createdIndex": 62188
   }
   ```
   However, when I describe `ApisixRoute` using kubectl, `plugin_config_name` appears.
   ```
   k describe apisixroute openapi-alimi-route
   Name:         openapi-alimi-route
   Namespace:    ingress-apisix
   Labels:       argocd.argoproj.io/instance=dev-apisix
   Annotations:  <none>
   API Version:  apisix.apache.org/v2
   Kind:         ApisixRoute
   Metadata:
     Creation Timestamp:  2023-03-23T02:03:16Z
     Generation:          3
     Managed Fields:
       API Version:  apisix.apache.org/v2
       Fields Type:  FieldsV1
       fieldsV1:
         f:status:
           .:
           f:conditions:
       Manager:      apisix-ingress-controller
       Operation:    Update
       Time:         2023-03-23T02:03:16Z
       API Version:  apisix.apache.org/v2
       Fields Type:  FieldsV1
       fieldsV1:
         f:metadata:
           f:annotations:
             .:
             f:kubectl.kubernetes.io/last-applied-configuration:
           f:labels:
             .:
             f:argocd.argoproj.io/instance:
         f:spec:
           .:
           f:http:
       Manager:         argocd-application-controller
       Operation:       Update
       Time:            2023-03-23T02:03:16Z
     Resource Version:  542685578
     UID:               9be6e2bc-1b42-4942-91cd-fc5118743cfe
   Spec:
     Http:
       Match:
         Hosts:
           ***
         Paths:
           ***
       Name:                ***
       plugin_config_name:  openapi-plugin-config
       Priority:            1
       Upstreams:
         Name:  cv-upstream
   Status:
     Conditions:
       Message:              Sync Successfully
       Observed Generation:  3
       Reason:               ResourcesSynced
       Status:               True
       Type:                 ResourcesAvailable
   Events:
     Type    Reason           Age                   From           Message
     ----    ------           ----                  ----           -------
     Normal  ResourcesSynced  4m32s (x15 over 48m)  ApisixIngress  ApisixIngress synced successfully
   ```
   
   Also, when I manually copied configuration in ApisixPluginConfig and pasted it in ApisixRoute, it works fine.


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