CDM Removal: EKS

When you’re done working with the CDM, you can remove it from Amazon Web Services by following this procedure:

Remove the CDM
  1. Run the skaffold delete command to shut down your deployment and remove it from your namespace.

  2. Log in to Pulumi using the local option or the Pulumi service. Be sure to log in the same way that you logged in when you created your cluster in Step 3 of Create a Kubernetes Cluster for the CDM.

  3. Remove your cluster:

    1. Change to the directory that contains the cluster configuration files:

      $ cd /path/to/forgeops/cluster/pulumi/aws/eks
    2. Select the Pulumi stack that you used when you created your cluster:

      $ pulumi stack select eks-medium
    3. Delete your cluster:

      $ pulumi destroy

      Pulumi provides a preview of the operation and issues the following prompt:

      Do you want to perform this destroy?

      Review the operation, and then select yes if you want to proceed.

    4. To verify that Pulumi removed the cluster, log in to the AWS console and select Services > EKS.

      You should not see the CDM cluster in the list of Kubernetes clusters.

  4. Remove networking infrastructure components:

    1. Change to the directory that contains the AWS infrastructure stack configuration files:

      $ cd /path/to/forgeops/cluster/pulumi/aws/infra
    2. Select the aws-infra Pulumi stack:

      $ pulumi stack select aws-infra
    3. Delete the infrastructure components:

      $ pulumi destroy

      Pulumi provides a preview of the operation and issues the following prompt:

      Do you want to perform this destroy?

      Review the operation, and then select yes if you want to proceed.

    4. To verify that Pulumi removed the infrastructure components, log in to the AWS console and select Services > VPC > VPCs.

      You should not see the eks-cdm VPC in the list of VPCs.

  5. Remove the CDM cluster from your local computer’s Kubernetes settings:

    1. Unset the KUBECONFIG environment variable:

      $ unset KUBECONFIG
    2. Run the kubectx command.

      The Kubernetes context for the CDM cluster should not appear in the kubectx command output.