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

   ### Issue description
   
   HI,
   I'm using Apisix chart 2.8.1 with Apisix 3.9.1 and cannot create metadata 
for DataDog plugin.
   Following 
https://github.com/apache/apisix-ingress-controller/issues/2125#issuecomment-1890984319
 I downgraded to Apisix 3.7 and unfortunately it doesn't work either.
   
   In both cases I'm using below code.
   
   ```
   apiVersion: apisix.apache.org/v2
   kind: ApisixGlobalRule
   metadata:
     name: global
   spec:
     plugins:
     - name: datadog
       enable: true
       config:
         host: "datadog-agent.datadog.svc.cluster.local"
         port: 8125
         namespace: "apisix"
   ```
   
   This adds global rule
   ```
   ❯ curl "http://127.0.0.1:9180/apisix/admin/global_rules/"; -H 'X-API-KEY: 
THEKEY'
   
{"total":1,"list":[{"key":"/apisix/global_rules/cd935c2f","value":{"id":"cd935c2f","plugins":{"datadog":{"port":8125,"prefer_name":true,"buffer_duration":60,"inactive_timeout":5,"retry_delay":1,"namespace":"apisix","name":"datadog","batch_max_size":1000,"max_retry_count":0,"host":"datadog-agent.datadog.svc.cluster.local"}},"create_time":1720782046,"update_time":1720783721},"modifiedIndex":641,"createdIndex":488}]}
   ```
   
   But not the metedata
   ```
   ❯ curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/ -H 'X-API-KEY: 
THEKEY'
   {"total":0,"list":[]}
   ```
   
   And in logs I still see
   ```
   2024/07/12 11:36:22 [error] 51#51: *6297 [lua] datadog.lua:172: 
send_metric_over_udp(): failed to report req body size to dogstatsd server: 
host[127.0.0.1] port[8125] err: connection refused, context: ngx.timer, client: 
10.103.10.44, server: 0.0.0.0:9080
   ```
   
   Adding plugin-metadata-config-map, does not make any difference
   ```apiVersion: v1
   kind: ConfigMap
   metadata:
     name: plugin-metadata-config-map
   data:
     config.yaml: |
       - cluster: default
         plugins:
         - name: datadog
           metadata:
             host: "datadog-agent.datadog.svc.cluster.local"
             port: 8125
             namespace: "apisix"
   ```
   
   I also tired using ApisixPluginConfig CRD and proper config line in 
ApisixRoute. This doesn't work as well.
   
   For now I have to manually call API by
   ```
   ❯ curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/datadog -H 
'X-API-KEY: THEKEY -X PUT -d '
   {
       "host": "datadog-agent.datadog.svc.cluster.local",
       "port": 8125,
       "constant_tags": [
           "source:dev",
           "service:apisix"
       ],
       "namespace": "apisix"
   }'
   ```
   
   How can I achieve this by using CRD?
   
   ### Environment
   
   - your apisix-ingress-controller version (output of 
apisix-ingress-controller version --long):
   - your Kubernetes cluster version (output of kubectl version):
   - if you run apisix-ingress-controller in Bare-metal environment, also show 
your OS version (uname -a):
   


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