In multi-tenant scenarios, Container Service for Kubernetes (ACK) signs and issues kubeconfig files that contain identity information to users with different roles. The kubeconfig files can be used to connect to ACK clusters. When an employee resigns or an issued kubeconfig file is disclosed, you can revoke the kubeconfig file to protect the cluster that the kubeconfig file can be used to access. This topic describes how to use an Alibaba Cloud account or a Resource Access Management (RAM) user to revoke an issued kubeconfig file.
Usage notes
Limits on clusters
To revoke a kubeconfig file that is used to access an ACK managed cluster or ACK dedicated cluster, the cluster must be created after October 15, 2019.
To revoke a kubeconfig file that is used to access an ACK Serverless cluster, the cluster must be created after September 6, 2019.
Use scenarios
You may need to revoke kubeconfig files in the following scenarios:
Use an Alibaba Cloud account to revoke the kubeconfig files of RAM users managed by the Alibaba Cloud account.
Use a RAM user to revoke the kubeconfig file of the RAM user.
After you revoke the kubeconfig file used to access a cluster, the system automatically assigns a new kubeconfig file to the cluster.
Use an Alibaba Cloud account to revoke the kubeconfig files of all RAM users managed by the Alibaba Cloud account
You can use an Alibaba Cloud account to revoke the kubeconfig files of only RAM users or RAM roles managed by the Alibaba Cloud account.
Use an Alibaba Cloud account to log on to the ACK console and perform the following steps:
Log on to the ACK console. In the left-side navigation pane, click Authorizations.
In the RAM user list on the RAM Users tab, click KubeConfig Management for a RAM user to view the list of clusters created by the RAM user. Then, follow the instructions to revoke kubeconfig files.
Use a RAM user to revoke the kubeconfig file of the RAM user
Use a RAM user to log on to the ACK console and perform the following steps:
After the kubeconfig file is revoked, the RAM user can no longer use the kubeconfig file to access the corresponding cluster. Proceed with caution.
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.
Click the Connection Information tab, click Revoke KubeConfig, and then click OK.
Revoke the kubeconfig file of a resigned employee or an untrusted user
To delete the RAM user or RAM role used by a resigned employee or an untrusted user, you must first use an Alibaba Cloud account to revoke the kubeconfig file of the RAM user or RAM role. Deleting only the RAM user or RAM role does not revoke the Role-Based Access Control (RBAC) permissions in the kubeconfig file of the RAM user or RAM role.
Before you revoke a kubeconfig file, make sure that no application in the corresponding cluster relies on the permissions in the kubeconfig file. For more information, see Use an Alibaba Cloud account to revoke the kubeconfig file of a RAM user.
If you accidentally deleted the RAM user used by a resigned employee or an untrusted user but have not revoked the kubeconfig file, perform the following steps. We recommend that you revoke the kubeconfig file of a RAM user before you delete the RAM user.