---
title: "How Does API7 Enterprise Proxy Applications in Kubernetes Clusters? - API7.ai"
description: "API7 Enterprise integrates with Kubernetes Service Discovery to help users proxy applications deployed in the Kubernetes cluster conveniently."
url: "https://api7.ai/blog/api7-enterprise-proxy-applications"
---

[Blog](https://api7.ai/blog)

[Products](https://api7.ai/category/products)[Technology](https://api7.ai/category/technology)[Ecosystem](https://api7.ai/category/ecosystem)[Case Study](https://api7.ai/category/usercase)[Team & Community](https://api7.ai/category/community)

Search

⌘ + K

[Blog](https://api7.ai/blog)

Products

# How Does API7 Enterprise Proxy Applications in Kubernetes Clusters?

January 24, 2024

[Products](https://api7.ai/category/products)

In the dynamic era of cloud-native technologies, [Kubernetes](https://api7.ai/solutions/vm-to-kubernetes) has emerged as the go-to solution for many enterprises seeking to build resilient and scalable applications. [API7 Enterprise](https://api7.ai/enterprise) offers powerful capabilities in security and traffic management, coupled with exceptional performance. API7 Enterprise integrates with the Kubernetes Service Discovery, serving as a proxy for applications deployed within a Kubernetes cluster. Let's go exploring the process of utilizing API7 Enterprise to proxy applications in your Kubernetes cluster.

## Prerequisites

1. Install [API7 Enterprise](https://api7.ai/try?product=enterprise)

**Note**: If API7 Enterprise is not already deployed within Kubernetes clusters, configure the network settings of the machine hosting API7 EE to ensure accessibility to upstream pods in the Kubernetes environment.

2. Deploy Services in Kubernetes

If you've already deployed services in Kubernetes, you can skip this step. Otherwise, execute the following command to create services:

```
# create a new namespace
kubectl create namespace api7ee

kubectl create deployment httpbin --image=kennethreitz/httpbin:latest -n api7ee
kubectl create service clusterip httpbin --tcp=80:80 -n api7ee
```

3. Create a Kubernetes Service Account

- API7 Enterprise relies on this credential for accessing the Kubernetes API and fetching upstream configurations. Consequently, We need to create an `RBAC` resource first. The following is the specific `YAML` file configuration:

  ```
    # rbac.yaml
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: api7-k8s-sd-watcher
    rules:
      - apiGroups: [""]
        resources: ["endpoints"]
        verbs: ["list", "watch"]
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: api7-k8s-sd-watcher-binding
    subjects:
      - kind: ServiceAccount
        name: api7-k8s-sd-sa
        namespace: api7ee
    roleRef:
      kind: ClusterRole
      name: api7-k8s-sd-watcher
      apiGroup: rbac.authorization.k8s.io
    ---
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: api7-k8s-sd-sa
      namespace: api7ee
    ---
    apiVersion: v1
    kind: Secret
    metadata:
      name: api7-k8s-sd-secret
      namespace: api7ee
      annotations:
        kubernetes.io/service-account.name: api7-k8s-sd-sa
    type: kubernetes.io/service-account-token
  ```

- Create RBAC resources and get this token.

  ```
  kubectl apply -f rbac.yaml -n api7ee
  kubectl get secrets api7-k8s-sd-secret -n api7ee -ojsonpath='{.data.token}' | base64 -d
  ```

## Implementation of Kubernetes Service Discovery in API7 Enterprise

### Connecting to the Kubernetes Service Registry

1. Go to an existing gateway group and access the **Service Registry** through the left-hand menu.
2. Click the **Add Service Registry Connection** button. Select Kubernetes as the discovery type and provide the Kubernetes API service access address and token.

![PA\_1](https://static.api7.ai/uploads/2024/01/22/m9FEZeDl_PA_1_ENG.png?imageMogr2/format/webp)

3. Once API7 Enterprise establishes a successful connection to the service registry, you will see a healthy status.

![PA\_2](https://static.api7.ai/uploads/2024/01/22/5Lgtl9VN_PA_2_ENG.png?imageMogr2/format/webp)

### Publishing the Service for Testing

1. Navigate to the service page, click to create a new service, and add the `/anything` route.
2. Proceed to publish the service, and choose the appropriate upstream:

![PA\_3](https://static.api7.ai/uploads/2024/01/22/z3v00kUZ_PA_3_ENG.png?imageMogr2/format/webp)

3. After publishing, you can test it using `curl`.

## Summary

In conclusion, we have talked about the steps to leverage the API7 Enterprise for proxying Kubernetes services. For more information about the features of the [API7 Enterprise](https://api7.ai/enterprise), please don't hesitate to [get in touch with us](https://calendly.com/api7).

Tags:

[Proxy Application](https://api7.ai/tags/proxy-application)

[Kubernetes Cluster](https://api7.ai/tags/kubernetes-cluster)

[APISIX Basics](https://api7.ai/tags/apisix-basics)

Share article link

Share

Related Posts

[![APISIX: Migrate etcd Operation From HTTP to gRPC](https://static.api7.ai/uploads/2024/09/06/8mFippBu_etcd.png)](https://api7.ai/blog/apisix-migrate-etcd-operation-from-http-to-grpc)

## [APISIX: Migrate etcd Operation From HTTP to gRPC](https://api7.ai/blog/apisix-migrate-etcd-operation-from-http-to-grpc)

[![FIPS 140-2 and Apache APISIX: Deployment Considerations](https://static.api7.ai/uploads/2024/09/06/rFoBcefJ_FIPS%20140-2.png)](https://api7.ai/blog/apisix-fips-140-2)

## [FIPS 140-2 and Apache APISIX: Deployment Considerations](https://api7.ai/blog/apisix-fips-140-2)

Table of Contents

- [Prerequisites](#prerequisites)

- [Implementation of Kubernetes Service Discovery in API7 Enterprise](#implementation-of-kubernetes-service-discovery-in-api7-enterprise)

  - [Connecting to the Kubernetes Service Registry](#connecting-to-the-kubernetes-service-registry)
  - [Publishing the Service for Testing](#publishing-the-service-for-testing)

- [Summary](#summary)

## Related Posts

[![Looking for APISIX Experts? Find API7.ai](https://static.api7.ai/uploads/2024/12/25/fIRLkUkG_api7-experts.png)](https://api7.ai/blog/apisix-expert-team-api7)

Products

October 20, 2023

#### [Looking for APISIX Experts? Find API7.ai](https://api7.ai/blog/apisix-expert-team-api7)

As the original creator of Apache APISIX, the dynamic, real-time, high-performance API gateway, API7.ai is transforming API management with its Expert Team.

[API Management](https://api7.ai/tags/api-management)

[APISIX Basics](https://api7.ai/tags/apisix-basics)

[![What Is LuaJIT? Why Does APISIX Choose LuaJIT?](https://static.api7.ai/uploads/2024/09/06/n3fzQtjH_LuaJIT.png)](https://api7.ai/blog/apisix-chooses-luajit)

Products

April 14, 2023

#### [What Is LuaJIT? Why Does APISIX Choose LuaJIT?](https://api7.ai/blog/apisix-chooses-luajit)

APISIX, a cloud-native API gateway, chooses LuaJIT as its technology stack due to its high flexibility and performance.

[APISIX Basics](https://api7.ai/tags/apisix-basics)

[API Gateway Concept](https://api7.ai/tags/api-gateway-concept)

[LuaJIT](https://api7.ai/tags/luajit)

[![How Apache APISIX Enables Wasm Functionality](https://static.api7.ai/uploads/2024/09/06/54B29TzW_Wasm-cover.png)](https://api7.ai/blog/how-apisix-supports-wasm)

Products

April 7, 2023

#### [How Apache APISIX Enables Wasm Functionality](https://api7.ai/blog/how-apisix-supports-wasm)

APISIX supports Wasm at the gateway level, allowing developers to use high-level programming languages to create Wasm plugins.

[APISIX Basics](https://api7.ai/tags/apisix-basics)

[API Gateway Concept](https://api7.ai/tags/api-gateway-concept)

[WebAssembly](https://api7.ai/tags/webassembly)
