renatomattos2912 opened a new issue, #1693:
URL: https://github.com/apache/apisix-ingress-controller/issues/1693

   ### Current Behavior
   
   When applying CRD for ApisixPluginConfig and ApisixRoute using 
plugin_config_name field to bound plugins to route, the bound is not being made 
after all, so each CRD is applied individually in kubernetes, no errors on 
that, but the plugin_config_name field is being ignored on route.
   
   This problem is very similar to that one: 
https://github.com/apache/apisix-ingress-controller/issues/1003, but the 
solution pointed not worked for me.
   
   ### Expected Behavior
   
   I expect that ApisixRoute bound with ApisixPluginConfig works when 
plugin_config_name is correctly added to route.
   
   ### Error Logs
   
   No errors logs
   
   ### Steps to Reproduce
   
   1. Run APISIX in a kubernete cluster using Helm with values bellow:
   
   ```
   global:
     imagePullSecrets: []
   
   apisix:  
     enabled: true
     enableIPv6: true
     enableServerTokens: true
     setIDFromPodUID: false  
     customLuaSharedDicts:
       []    
     luaModuleHook:
       enabled: false    
       luaPath: ""    
       hookPoint: ""    
       configMapRef:      
         name: ""      
         mounts:        
           - key: ""          
             path: ""
     
     httpRouter: radixtree_uri
   
     enableCustomizedConfig: false
     customizedConfig: {}    
   
     image:    
       repository: apache/apisix    
       pullPolicy: IfNotPresent    
       tag: 3.1.0-debian
     
     kind: Deployment
     replicaCount: 1  
     priorityClassName: ""  
     podAnnotations: {}
     podSecurityContext:
       {}    
     securityContext:
       {}   
     
     podDisruptionBudget:
       enabled: false    
       minAvailable: 90%    
       maxUnavailable: 1
     
     resources:
       {}
   
     hostNetwork: false
     nodeSelector: {}
     tolerations: []
     affinity: {} 
     timezone: ""
     extraEnvVars: []
   
   nameOverride: ""
   fullnameOverride: ""
   
   serviceAccount:
     create: false
     annotations: {}
     name: ""
   
   rbac:
     create: false
   
   gateway:
     type: LoadBalancer
     externalTrafficPolicy: Cluster  
     annotations:
       service.beta.kubernetes.io/aws-load-balancer-type: nlb    
     externalIPs: []  
     http:
       enabled: true
       servicePort: 80
       containerPort: 9080  
     tls:
       enabled: true
       servicePort: 443
       containerPort: 9080    
       existingCASecret: ""    
       certCAFilename: ""
       http2:
         enabled: true    
       sslProtocols: "TLSv1.2 TLSv1.3"  
     stream:
       enabled: false
       only: false
       tcp: []
       udp: []  
     ingress:
       enabled: false    
       annotations:
         {}      
       hosts:
         - host: apisix.local
           paths: []
       tls: []  
   
   admin:  
     enabled: true  
     type: ClusterIP  
     externalIPs: []  
     port: 9180  
     servicePort: 9180  
     cors: true  
     credentials:    
       admin: edd1c9f034335f136f87ad84b625c8f1    
       viewer: 4054f7cf07e344346cd3f287985e76a2
   
     allow:    
       ipList:
         - 127.0.0.1/24  
     ingress:
       enabled: false    
       annotations:
         {}      
       hosts:
         - host: apisix-admin.local
           paths:
             - "/apisix"
       tls: []  
   
   nginx:
     workerRlimitNofile: "20480"
     workerConnections: "10620"
     workerProcesses: auto
     enableCPUAffinity: true
     envs: []
   
   plugins:
     - api-breaker
     - authz-keycloak
     - basic-auth
     - batch-requests
     - consumer-restriction
     - cors
     - echo
     - fault-injection
     - file-logger
     - grpc-transcode
     - hmac-auth
     - http-logger
     - ip-restriction
     - ua-restriction
     - jwt-auth
     - kafka-logger
     - key-auth
     - limit-conn
     - limit-count
     - limit-req
     - node-status
     - openid-connect
     - authz-casbin
     - prometheus
     - proxy-cache
     - proxy-mirror
     - proxy-rewrite
     - redirect
     - referer-restriction
     - request-id
     - request-validation
     - response-rewrite
     - serverless-post-function
     - serverless-pre-function
     - sls-logger
     - syslog
     - tcp-logger
     - udp-logger
     - uri-blocker
     - wolf-rbac
     - zipkin
     - traffic-split
     - gzip
     - real-ip
     - ext-plugin-pre-req
     - ext-plugin-post-req
   stream_plugins:
     - mqtt-proxy
     - ip-restriction
     - limit-conn
   
   pluginAttrs: {}
   
   extPlugin:
     enabled: false  
     cmd: ["/path/to/apisix-plugin-runner/runner", "run"]
   
   wasmPlugins:  
     enabled: false
     plugins: []
   
   customPlugins:
     enabled: false  
     luaPath: "/opts/custom_plugins/?.lua"
     plugins:    
       - name: ""      
         attrs: {}      
         configMap:        
           name: ""        
           mounts:
             - key: ""
               path: ""
             - key: ""
               path: ""
   
   updateStrategy:
     {}
   
   extraVolumes: []
   
   extraVolumeMounts: []
   
   extraInitContainers: []
   
   discovery:  
     enabled: false  
     registry:
       {}
       
   logs:  
     enableAccessLog: true  
     accessLog: "/dev/stdout"  
     accessLogFormat: '$remote_addr - $remote_user [$time_local] $http_host 
\"$request\" $status $body_bytes_sent $request_time \"$http_referer\" 
\"$http_user_agent\" $upstream_addr $upstream_status $upstream_response_time 
\"$upstream_scheme://$upstream_host$upstream_uri\"'  
     accessLogFormatEscape: default
     errorLog: "/dev/stderr"
     errorLogLevel: "warn"
   
   dns:
     resolvers:
       - 127.0.0.1
       - 172.20.0.10
       - 114.114.114.114
       - 223.5.5.5
       - 1.1.1.1
       - 8.8.8.8
     validity: 30
     timeout: 5
   
   initContainer:  
     image: busybox  
     tag: 1.28
   
   autoscaling:
     enabled: false
     minReplicas: 1
     maxReplicas: 100
     targetCPUUtilizationPercentage: 80
     targetMemoryUtilizationPercentage: 80
   
   configurationSnippet:
     main: |
   
     httpStart: |
   
     httpEnd: |
   
     httpSrv: |
   
     httpAdmin: |
   
     stream: |
   
   serviceMonitor:
     enabled: false  
     namespace: ""  
     name: ""  
     interval: 15s  
     path: /apisix/prometheus/metrics  
     metricPrefix: apisix_  
     containerPort: 9091  
     labels:
       {}    
     annotations:
       {}    
   etcd:  
     enabled: true  
     host:    
       - http://etcd.host:2379  
     prefix: "/apisix"
     timeout: 30
   
     auth:
       rbac:      
         create: false      
         user: ""      
         password: ""
       tls:      
         enabled: false    
         existingSecret: ""      
         certFilename: ""      
         certKeyFilename: ""      
         verify: true
         sni: ""
   
     service:
       port: 2379
   
     replicaCount: 3
   
   ingress-controller:
     enabled: true
     config:
       apisix:
         adminAPIVersion: "v3"
         serviceNamespace: apisix
   
   vault:
     enabled: false
     host: ""
     timeout: 10
     token: ""
     prefix: ""
   ```
   
   2. Apply CRD to create ApisixPluginConfig
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixPluginConfig
   metadata:
     name: public-endpoints
     namespace: apisix
   spec:
     plugins:
       - name: cors
         enable: true
         config:
           allow_origins: http://localhost:3000
           allow_credential: true
           allow_methods: "**"
           allow_headers: "**"
           expose_headers: "**"    
   ```
   
   3. Apply CRD to create ApisixRoute bounded to ApisixPluginConfig
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixRoute
   metadata:
     name: route-test
     namespace: apisix
   spec:
     http:
       - name: rule1
         match:
           hosts:
             - localhost
           paths:
             - /test
           methods:
             - OPTIONS
             - GET
         backends:
           - serviceName: httpbin
             servicePort: 80      
         plugin_config_name: public-endpoints 
   ```
   
   4. Check if plugins is applied or not.
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.1.0
   - Operating system (run `uname -a`): Kubernetes 1.22 in AWS EKS
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): 3.5.0
   - APISIX Dashboard version, if relevant: 2.15.0
   - Apisix Helm Version: apisix-1.1.1 (Ingress controller installed via the 
same helm)


-- 
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: [email protected]

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

Reply via email to