Skip to main content

1. Retrieving Cluster Information

Run the following command to get the Kubernetes API server address and port:
Note the Kubernetes control plane address and port from the output. This information will be used when defining the reverse proxy in Apinizer.

2. Adding a Reverse Proxy in Apinizer

Create a reverse proxy definition in Apinizer for the relevant cluster. Use the address from the kubectl cluster-info output as the backend.

Request Policy Configuration

To ensure the Kubernetes API works properly with kubectl, add the following header transformations under Request Policy → Business Rule:
If these header transformations are not applied, kubectl requests gzip-compressed and specially formatted responses from Kubernetes. While processing these responses, Apinizer may truncate the JSON, causing an unexpected end of JSON input error.

3. Generating a Token

Run the following commands on a machine that has access to the Kubernetes cluster: Create service account:
Assign cluster-admin role:
Generate token (valid for 1 year):
Copy the token value from the output of the last command and store it securely. This token will be used in the kubeconfig file in the next step. When the token expires, repeat this step to generate a new one.

4. Preparing the Kubeconfig File

On Windows, kubectl reads cluster connection information from the %USERPROFILE%\.kube\config file. This file is usually located at:
To create the file, run the following commands in CMD:
When Notepad opens, paste the following template, fill in the required fields, and save:
The insecure-skip-tls-verify: true setting is required because Apinizer’s TLS certificate differs from the Kubernetes certificate.