liangbeirong-byron commented on issue #13877:
URL: https://github.com/apache/apisix/issues/13877#issuecomment-5422008044

   > 您是如何管理 APISIX 
配置的?我注意到它`apisix-ingress-controller`存在,那么路由以及相关配置是否`GatewayProxy`都通过它进行管理?
   > 
   > 如果情况确实如此,那么这可能导致当前问题。当`GatewayProxy`存在 APISIX 
时,控制器会将其视为完全托管的。在每次周期性同步(`syncPeriod`使用默认图表`1m`)以及每次 Gateway/IngressClass 
协调时,它都会运行一次 ADC 同步,以同步整个期望状态,并且 ADC 会删除 Admin API 
中所有未在期望状态中声明的内容,`plugin_metadata`包括 APISIX 本身。因此`PUT`,您的 APISIX 
请求成功后,控制器会在大约一分钟内将其删除,这与您在新 Pod 上看到的情况一致。
   > 
   > 我使用控制器使用的同一 ADC 重现了这个问题:之后`PUT plugin_metadata/prometheus`,`adc 
sync`配置中没有`plugin_metadata`日志`Delete plugin_metadata: "prometheus"`,并且管理 API 
随后返回 404。
   > 
   > 您可以自行确认:
   > 
   > curl -i 
"http://apisix-admin.apisix.svc.cluster.local:9180/apisix/admin/plugin_metadata/prometheus";
 -H "X-API-KEY: ..."
   > # 404 here means the controller removed it
   > 如果情况确实如此,请在控制器中声明元数据,`GatewayProxy`以便控制器拥有它:
   > 
   > apiVersion: apisix.apache.org/v1alpha1
   > kind: GatewayProxy
   > metadata:
   >   name: apisix-config   # your existing GatewayProxy
   >   namespace: apisix
   > spec:
   >   provider:
   >     ...                 # keep as is
   >   pluginMetadata:
   >     prometheus:
   >       disabled_labels:
   >         http_status: ["node", "matched_uri", "matched_host"]
   > 如果图表已为您创建了 GatewayProxy(`ingress-controller.gatewayProxy.createDefault: 
true`),请将相同的代码块添加`ingress-controller.gatewayProxy.pluginMetadata`到您的 Helm 
值中。然后应该会显示新的示例`node=""`。
   > 
   > 您能先确认一下吗?
   
   
   Hi @janiussyafiq   I understand, thank you very much. I have resolved the 
issue following your instructions.
   ```
    kubectl exec -it curl-shell -- sh
   ~ $ ls
   ~ $ curl -i 
"http://apisix-admin.apisix.svc.cluster.local:9180/apisix/admin/plugin_metadata/prometheus";
 -H "X-API-KEY: 1111111111111"
   HTTP/1.1 200 OK
   Date: Wed, 26 Aug 2026 07:14:47 GMT
   Content-Type: application/json
   Transfer-Encoding: chunked
   Connection: keep-alive
   Server: APISIX/3.18.0
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   X-API-VERSION: v3
   
   
{"value":{"id":"prometheus","disabled_labels":{"http_status":["node","matched_uri","matched_host"]}},"createdIndex":1143341,"modifiedIndex":1143341,"key":"/apisix/plugin_metadata/prometheus"}
   
   
   apiVersion: apisix.apache.org/v1alpha1
   kind: GatewayProxy
   metadata:
     annotations:
       meta.helm.sh/release-name: apisix
       meta.helm.sh/release-namespace: apisix
     creationTimestamp: "2025-12-01T08:01:51Z"
     generation: 3
     labels:
       app.kubernetes.io/managed-by: Helm
     name: apisix-config
     namespace: apisix
     resourceVersion: "78436774"
     uid: 34b1f355-5619-480c-80f9-674a8b45fde5
   spec:
     pluginMetadata:
       prometheus:
         disabled_labels:
           http_status:
           - node
           - matched_uri
           - matched_host
     provider:
       controlPlane:
         auth:
           adminKey:
             value: 1111111111111
           type: AdminKey
         service:
           name: apisix-admin
           port: 9180
       type: ControlPlane
   
   ```


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