All Products
Search
Document Center

Container Compute Service:Control public access to the API server of a cluster

Last Updated:Sep 16, 2025

You can use an elastic IP address (EIP) to expose the API server of a Kubernetes cluster. After you attach an EIP, the API server can be accessed over the Internet. You can attach an EIP when you create a cluster or after the cluster is created. This topic describes how to control public access to the API server by attaching and detaching an EIP.

Attach an EIP when you create a cluster

When you create an ACS cluster, select Expose API Server With An EIP to enable public network access on the cluster API server.

image

Attach an EIP after you create a cluster

If you did not enable public access to the API server when you created the cluster, follow these steps to attach an EIP.

  1. Log on to the ACS console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane of the cluster details page, click Cluster Information.

  3. On the Cluster Information page, click the Basic Information tab. In the Network section, click Associate EIP to the right of API server Public Endpoint. Follow the on-screen instructions to select an existing EIP or create an EIP in the same region as the cluster. Then, click OK.

    After the EIP is associated, it is displayed in the API server Public Endpoint field.

Important

Attaching an EIP causes the API server to briefly restart. Avoid performing operations on the cluster during the restart.

Change or detach an EIP

After attaching an EIP, you can also change or detach it on the Basic Information tab of the Cluster Information page.

  1. Log on to the ACS console. In the left-side navigation pane, click Clusters.

  2. On the Clusters page, find the cluster that you want to manage and click its name. In the left-side navigation pane of the cluster details page, click Cluster Information.

  3. On the Cluster Information page, click the Basic Information tab. In the Network section, click Associate EIP or Unbind to the right of API server Public Endpoint.

Important
  • After you detach the EIP, the API server of the cluster is no longer publicly accessible.

  • Changing or detaching an EIP causes the API server to briefly restart. Avoid performing operations on the cluster during the restart.