CDM Removal: GKE

When you’re done working with the CDM, you can remove it from Google Cloud Platform 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/gcp/gke
    2. Select the Pulumi stack that you used when you created your cluster:

      $ pulumi stack select gke-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 Google Cloud console and select the Kubernetes Engine option.

      You should not see the CDM cluster in the list of Kubernetes clusters in your Google Cloud project.

  4. Remove networking infrastructure components:

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

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

      $ pulumi stack select gcp-infra
      • 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.

      • To verify that Pulumi removed the infrastructure components, log in to the Google Cloud console. Select the VPC Networks option.

        The network formerly used for CDM infrastructure should no longer be listed.

  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.