Container Service for Kubernetes (ACK) allows you to use an elastic IP address (EIP) to expose the API server of a cluster. After you use an EIP to expose the API server of a cluster, the API server can be accessed over the Internet. You can associate an EIP with the API server of a cluster when you create the cluster or after the cluster is created. This topic describes how to control public access to the API server of a cluster by associating an EIP with or disassociating an EIP from the API server.
Usage notes
After you associate an EIP with the API server of a cluster, make sure that the EIP is in the normal state. If you disassociate the EIP, the API server cannot be accessed over the Internet.
Associate an EIP with the API server when you create a cluster
When you create a cluster, you can select Expose API Server with EIP to allow public access to the API server of the cluster. For more information about how to create a cluster, see Create an ACK managed cluster, Create an ACK Serverless cluster, and Create an ACK Edge cluster in the console.
Associate an EIP with the API server after a cluster is created
If you do not select Expose API Server with EIP when you create a cluster, you can perform the following steps to associate an EIP with the API server after the cluster is created.
You can associate an EIP with the API server of a cluster after the cluster is created only if the cluster is an ACK Basic cluster, ACK Pro cluster, ACK Serverless cluster, or ACK Edge cluster.
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, click Cluster Information.
On the Cluster Information page, click the Basic Information tab. In the Cluster Information section, click Associate EIP.
In the Associate EIP dialog box, select an existing EIP and click OK. You can also click Create EIP to create an EIP by following the instructions.
After the EIP is associated with the API server, a public IP address appears on the right side of the API Server Public Endpoint field.
ImportantThe API server restarts after you associate an EIP with the API server. We recommend that you do not perform operations on the cluster during the restart process.
Disassociate or change an EIP
ACK allows you to disassociate an EIP from the API server or change the EIP. After you disassociate the EIP from the API server of a cluster, the API server cannot be accessed over the Internet.
Only ACK Basic clusters, ACK Pro clusters, and ACK Serverless clusters support the Change EIP and Disassociate EIP features.
References
If you require fine-grained access control on the API server, you can configure network ACLs as whitelists or blacklists to limit access to the API server. For more information, see Configure network ACLs for the API server of an ACK cluster.