Deregistering a cluster - Amazon EKS

Deregistering a cluster

If you are finished using a connected cluster, you can deregister it. After it's deregistered, the cluster is no longer visible in the Amazon EKS console.

You must have the following permissions to call the deregisterCluster API:

  • eks:DeregisterCluster

  • ssm:DeleteActivation

  • ssm:DeregisterManagedInstance

eksctl

Prerequisites

  • eksctl version 0.68 or later must be installed. To install or upgrade it, see Getting started with eksctl.

  • Ensure the Amazon EKS Connector agent role was created. .

To deregister your cluster with eksctl

AWS CLI

Prerequisites

  • AWS CLI must be installed. To install or upgrade it, see Installing the AWS CLI.

  • Ensure the Amazon EKS Connector agent role was created. .

Deregister the connected cluster.

aws eks deregister-cluster \ --name my-cluster \ --region region-code
AWS Management Console
  1. Open the Amazon EKS console at https://console.aws.amazon.com/eks/home#/clusters.

  2. Choose Clusters.

  3. On the Clusters page, select the connected cluster and select Deregister.

  4. Confirm that you want to deregister the cluster.

To clean up the resources on your Kubernetes cluster.

  1. Delete the Amazon EKS Connector YAML file from your Kubernetes cluster.

    kubectl delete -f eks-connector.yaml
  2. If you created clusterrole or clusterrolebinding for an additional IAM user to access the cluster, ensure that you delete them from your Kubernetes cluster.