# Kong Manager on Kubernetes: Access admin API as a Cluster IP Service

**URL:** <https://discuss.konghq.com/t/kong-manager-on-kubernetes-access-admin-api-as-a-cluster-ip-service/10938>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [November 29, 2022, 3:50pm UTC](https://discuss.konghq.com/t/kong-manager-on-kubernetes-access-admin-api-as-a-cluster-ip-service/10938 "2022-11-29T15:50:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farhan\_Aslam](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/farhan_aslam/32/2664_2.png) [@Farhan\_Aslam](https://discuss.konghq.com/u/Farhan_Aslam)\
**Post date:** [November 29, 2022, 3:50pm UTC](https://discuss.konghq.com/t/kong-manager-on-kubernetes-access-admin-api-as-a-cluster-ip-service/10938/1 "2022-11-29T15:50:07Z")

</div>

I’m using Kong Enterprise on Kubernetes and trying to set up Kong Manager using the Kubernetes Ingress Controller. The only way I have been able to get Kong Manager to successfully connect to the Admin API is by either setting up the Admin API service as a load balancer with an external IP or exposing it through ingress. However, I’d prefer to not expose the Admin API service publicly. I’ve tried setting up basic auth on the admin API but that does not work. Is there a way I could connect to the Admin API using the cluster IP? Setting up the service as a cluster IP service and setting KONG\_ADMIN\_API\_URI to the cluster IP or service host name does not work:

```auto
- name: KONG_ADMIN_API_URI
  value: "http://kong-admin-api:8001"

```

---

<div class="post-metadata">

**Author:** ![traines](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/traines/32/158_2.png) [@traines](https://discuss.konghq.com/u/traines)\
**Post date:** [December 2, 2022, 8:42pm UTC](https://discuss.konghq.com/t/kong-manager-on-kubernetes-access-admin-api-as-a-cluster-ip-service/10938/2 "2022-12-02T20:42:31Z")

</div>

You can create a ClusterIP Service, but I’m not sure it’d be that useful, since your client is presumably outside the cluster. That’d be more to provide a means for other Pods interact with the admin API.

The closest equivalent for an outside-cluster client is to use `kubectl port-forward` to tunnel from your machine into the container network. Accessing the GUI and admin API using a port forward should work fine–it’s a bit clunky, but will do in a pinch.

With full Enterprise, [RBAC](https://docs.konghq.com/gateway/latest/kong-manager/auth/rbac/#main) is the recommended option. The service will be public, but will require authentication.

With free mode, you’d want one of the [non-RBAC options](https://docs.konghq.com/gateway/latest/production/running-kong/secure-admin-api/#main). For the option where you connect through the proxy, configuring a shared [session plugin](https://docs.konghq.com/hub/kong-inc/session/) for both the GUI and API should work well. Exposing the API via a path (note that you need to set [admin\_gui\_url](https://docs.konghq.com/gateway/latest/reference/configuration/#admin_gui_url) and [admin\_api\_uri](https://docs.konghq.com/gateway/latest/reference/configuration/#admin_api_uri)), e.g. the GUI at `example.com/` and the API at `example.com/api` should work best, since it avoids needing to deal with cookie domains and cross-origin concerns.

---

<div class="post-metadata">

**Author:** ![Farhan\_Aslam](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/farhan_aslam/32/2664_2.png) [@Farhan\_Aslam](https://discuss.konghq.com/u/Farhan_Aslam)\
**Post date:** [December 7, 2022, 4:00am UTC](https://discuss.konghq.com/t/kong-manager-on-kubernetes-access-admin-api-as-a-cluster-ip-service/10938/3 "2022-12-07T04:00:50Z")

</div>

Thanks for the help! I’ll give this a shot.
