apisix-helm-chart icon indicating copy to clipboard operation
apisix-helm-chart copied to clipboard

how to access ControlAPI of APISIX?

Open mkyc opened this issue 2 years ago • 5 comments

I want to be able to monitor APISIX gateway deployment instance from my AWS ALB load balancer. I just want to monitor that gateway instance is UP, and not focus on specific routes. It looks to me that server-info plugin is perfect for that. According to documentation I need to access /v1/server_info endpoint from ALB. As far as I can tell from helm chart ControlAPI port (9090) is not exposed from pod and there is no corresponding configuration to expose it in apisie-gateway or apisix-admin services. Am I correct? Is there any possible workaround?

mkyc avatar Dec 30 '22 17:12 mkyc

You can expose the control api outside, with assigning its ip address to 0.0.0.0 (in the config.yaml). But it's not supported by helm chart, we may need to extend the helm chart first.

tokers avatar Dec 31 '22 05:12 tokers

Ok, I get it. AFAICT I'd need to add some k8s Service as well, separately from helm chart. Because of this documentation line I guess it would make sense to introduce some controlAPI.expose (or anything like that) helm chart parameter. Otherwise one needs to move whole config.yaml to values.yaml variable, which is not super convenient.

mkyc avatar Dec 31 '22 17:12 mkyc

I believe the Helm Chart still does not support exposing the Control API, but it's enabled by default, right?

brunopadz avatar Jun 06 '24 22:06 brunopadz

Dears, I found the way to integrate apisix control service with ingress, hope this can help you guys. You can try the control serivce by following command with my new code

helm upgrade --install apisix . \
--create-namespace --namespace apisix \
--set ingress.enabled=true \
--set ingress.className=nginx \
--set "ingress.hosts[0].host=apisix\.local" \
--set "ingress.hosts[0].paths[0]=\/" \
--set apisix.admin.enabled=true \
--set apisix.admin.ingress.enabled=true \
--set apisix.admin.ingress.className=nginx \
--set control.enabled=true \
--set control.ingress.enabled=true \
--set control.ingress.className=nginx

Image

kzmain avatar Feb 21 '25 19:02 kzmain

I'm using 2.0.0-RC5 so things might have changed.

Given https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/templates/service-control.yaml#L16, I only added apisix.enabled to the values file (since control.enabled is true by default) and helm upgrade. Then I can see:

Image

I don't quite understand the intention of apisix.enabled however. It seems to be only controlling whether control API service is enabled.

kayx23 avatar Oct 22 '25 09:10 kayx23